Bill Gradwohl wrote:
> BTW - I ran thru the archives via a search for 'indirection' and for the
> longest time was confused by references to addr...@hidden scattered
> throughout the code examples. Here's an example:
> http://lists.gnu.org/archive/html/bug-bash/2002-11/msg00085.html
>
> I did a ma
Bill Gradwohl writes:
> I tried it with and without and it doesn't appear to make a difference.
Try adding spaces or other special characters to the value of
$makeTempFileName. The variable should be expanded during the rescan
done by eval, not before.
Andreas.
--
Andreas Schwab, sch...@linu
On Fri, 2009-04-24 at 19:54 +0200, Andreas Schwab wrote:
> Use eval.
>
>eval $x=\${makeTempFileName}
After you mentioned it, I remembered reading about eval a long time ago
and couldn't understand what it was good for. Now I know. Thank You.
Why the backslash before the $ ?
I tried it with
Bill Gradwohl 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
On Fri, Apr 24, 2009 at 11:49:43AM -0600, Bill Gradwohl wrote:
> This is a trivial example, but gives you the idea.
> for x in 'VAR_A' 'VAR_B' 'VAR_C'; do
># What I'd like to say is
>!x="hello"
> done
In bash 4, you can use associative arrays, which gives you what you
really want.
Apart
It appears that indirection can only be used as an rvalue. Is there any
way to use indirection as an lvalue?
This is a trivial example, but gives you the idea.
for x in 'VAR_A' 'VAR_B' 'VAR_C'; do
# What I'd like to say is
!x="hello"
done
resu