On Thursday 03 April 2003 08:01 pm, Bob Proulx wrote:
> Craig Dickson wrote:
> > echo $var=$(eval echo \$$var)
>
> That works. Personally I prefer to eval the entire line. This way
> you only use one layer of processing rather than the two in the above.
>
> for var in FOO BLAH ; do
>
Indeed, eval did the trick, exactly what I wanted to do. Thanks to all
who responded, you were most helpful.
-Corey
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
On Fri, Apr 04, 2003 at 12:34:33AM +0100, Colin Watson wrote:
> On Thu, Apr 03, 2003 at 01:58:35PM -0800, Corey Hickey wrote:
> > #!/bin/bash
> >
> > FOO=bar
> > BLAH=blarg
> >
> > for var in FOO BLAH ; do
> > echo $var = $"$var" #this part is messed up
> > done
>
> Try this, which I believe
Craig Dickson wrote:
> echo $var=$(eval echo \$$var)
That works. Personally I prefer to eval the entire line. This way
you only use one layer of processing rather than the two in the above.
for var in FOO BLAH ; do
eval echo $var = \$$var;
done
For those following this scripting di
On Thu, Apr 03, 2003 at 01:58:35PM -0800, Corey Hickey wrote:
> This isn't exactly a debian-specific question, but I'm not sure where
> else to turn.
>
> I'm writing a bash script wherein I have a list of variables of which I
> want to return the values. A script representative of what I am trying
Corey Hickey wrote:
> I'm writing a bash script wherein I have a list of variables of which I
> want to return the values. A script representative of what I am trying
> to do would be like this:
>
>
> #!/bin/bash
>
> FOO=bar
> BLAH=blarg
>
> for var in FOO BLAH ; do
> echo $var = $"$var"
Hello,
This isn't exactly a debian-specific question, but I'm not sure where
else to turn.
I'm writing a bash script wherein I have a list of variables of which I
want to return the values. A script representative of what I am trying
to do would be like this:
#!/bin/bash
FOO=bar
BLAH=blarg
for va
7 matches
Mail list logo