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
> to do would be like this:
> 
> 
> #!/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 to be the best way:

  echo '$var = ' `eval 'echo "$foo"'`

Cheers,

-- 
Colin Watson                                  [EMAIL PROTECTED]


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to