Sorry, I overlooked the indirection (and the missing semicolon). On Mon, Jul 25, 2011 at 10:18 PM, Bob Proulx <b...@proulx.com> wrote: > Dennis Williamson wrote: >> Linda Walsh wrote: >> > GLOBAL="hi there" >> > {foo=GLOBAL echo ${!foo}; } > > Note that this tickles a problem since foo isn't set before $foo is > expanded. Use this following with a semicolon instead: > > GLOBAL="hi there" > {foo=$GLOBAL; echo ${!foo}; } > >> You had a missing dollar sign. >> >> I'm assuming you meant: >> >> GLOBAL="hi there" >> {foo=$GLOBAL echo ${!foo}; } > > Er.. No. There is a missing semicolon as described above and in > other messages in the thread but the dollar size is intended to be > excluded so that foo contains the string "GLOBAL" and ${!foo} will > indirect through it. > . . . > Bob >
-- Visit serverfault.com to get your system administration questions answered.