For example:
export MY_VAR_$1=10 if [ $2 -eq "new" ]; then MY_VAR_$1=`uname -r` ./another_script MY_VAR_$1 fi
The "export"-part works, but the rest of it doesn't.
If I "source" the script with the parameters "JOHN" and "new", printenv shows "MY_VAR_JOHN" but the
"MY_VAR_$1=`uname -r`" fails: shell doesn't find COMMAND "MY_VAR_JOHN".
Why does the shell think the variable name is a command? How should that be done?
This post has been edited by turboscrew: 15 March 2013 - 07:02 AM

New Topic/Question
Reply



MultiQuote





|