Bill Gradwohl <b...@ycc.com> writes:

> My real world need is to assign temporary file names to named variables.
>
> makeTempFileName=''
> for x in 'TEMPLOG' 'TEMPFILELEFT' 'TEMPFILERIGHT'; do
>    makeTemp "${x}"   # function that does a lot of processing and
>                      # sets makeTempFileName equal
>                      # to /tmp/blahblah.??????
>    !x="${makeTempFileName}"
> done 

Use eval.

for x in 'TEMPLOG' 'TEMPFILELEFT' 'TEMPFILERIGHT'; do
   makeTemp "${x}"   # function that does a lot of processing and
                     # sets makeTempFileName equal
                     # to /tmp/blahblah.??????
   eval $x=\${makeTempFileName}
done 

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Reply via email to