Monday, 12 August 2013

Why is variable interpolation not working for variable assignment (for bash)?

Why is variable interpolation not working for variable assignment (for bash)?

I have this script: ROOT=/tmp LOG=$ROOT/blah.log echo $LOG
The output is: /blah.log
obviously the ROOT variable is not being interpolated which is very
unexpected. If I echo the $ROOT, it correctly shows /tmp. Hence something
fishy is going on here.
Please help.
Thanks

No comments:

Post a Comment