[TriLUG] bash weirdness

Joseph Mack NA3T jmack at wm7d.net
Mon Apr 6 18:24:15 EDT 2009


On Mon, 6 Apr 2009, stan briggs 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`.


not familiar with the output of `dpkg`, but assuming $line 
is a command with a redirect, is this anything like what 
you're after?

file=foobar.ls
rm -rf $file
echo "ls > foobar.ls " > foo.out
line=`cat foo.out`
eval $line
cat $file

Joe

-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!



More information about the TriLUG mailing list