Unable to export variables declared in a script
hi all,
How do I declare/initialize an environment variable in a script? i have a file named set-abcd.sh. *** setabcd.sh ***** MESS=hello ; export MESS echo $MESS ****************** $ MESS=yahoo ; export MESS $ echo $MESS yahoo $ ./set-abcd.sh hello $ echo $MESS yahoo Please help! thanks, Joe |
Works as designed. What you want to do isn't to RUN
the script, but instead source it. E.g. Code:
. my_script.sh Code:
source my_script.sh Cheers, Tink |
thanks tinkster! source did the trick!
|
All times are GMT -5. The time now is 03:38 AM. |