Re: bash question: reporting a variable named within a variable

2003-04-04 Thread Rob Sims
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 >

Re: bash question: reporting a variable named within a variable

2003-04-04 Thread Corey Hickey
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]

Re: bash question: reporting a variable named within a variable

2003-04-03 Thread Colin Watson
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

Re: bash question: reporting a variable named within a variable

2003-04-03 Thread Bob Proulx
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

Re: bash question: reporting a variable named within a variable

2003-04-03 Thread Colin Watson
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

Re: bash question: reporting a variable named within a variable

2003-04-03 Thread Craig Dickson
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"

bash question: reporting a variable named within a variable

2003-04-03 Thread Corey Hickey
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