[TriLUG] bash weirdness

Ron Young ronyoung at nc.rr.com
Tue Apr 7 08:00:46 EDT 2009


Stan,
This worked on my system:

#!/bin/bash

#line="dpkg -l > all-packages.txt";
# my system does not have dpkg installed


line=`ls -ln > line.txt`;
echo $line;

exec $line;

cat line.txt



Ron Young
919-621-9015

+++++++++++++++++++
Little tiny dreams require little tiny thoughts and little tiny steps.
Great big dreams require great big thoughts and little tiny steps.
+++++++++++++++++++


On Mon, Apr 6, 2009 at 4:45 PM, stan briggs <stan at stanbriggs.com> wrote:

> all,
>
> i'm trying to get a series of commands to execute with a bash shell.
> someting like this:
> line="dpkg -l > all-packages.txt"
> which i then try to execute with
> $line
> `$line`
> output=`$line`.
> none seem to execute the command. i'm guessing it has to do with the pipe
> symbol and explains why similar commands with shell re-directs in them
> fail,
> also.
>
> can anyone point me to a good reference that explains this?
>
> thanks,
> stan
>
> --
> Stan B. Briggs
> +1-919-414-9513
> +++++++++++++++++++
> the oBoJ Foundation is the open source community coming together for the
> benefit of society. our events and work are for the purpose of raising
> awareness, raising funds, and performing activities for good causes.
> participation is open to all who wish to support worthwhile public causes.
> www.oBoJ.org
> +++++++++++++++++++
> Little tiny dreams require little tiny thoughts and little tiny steps.
> Great big dreams require great big thoughts and little tiny steps.
> +++++++++++++++++++
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG FAQ  : http://www.trilug.org/wiki/Frequently_Asked_Questions
>



More information about the TriLUG mailing list