[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: setting environmental vars with scripts



John Taber wrote:
I try to set an environment var in a simple script like
QTDIR=/usr/local/Qt-323-Win
export QTDIR
echo $QTDIR

when I run the script it echos back the correct path but when I go to my konsole and type echo $QTDIR it is not there . However if I type the script commands in the konsole, then it is there. Any explanation for this ? and how I can get a script to work ?

You can achieve "inheritance" of variables by issuing

source your_script_file

and not running the script itself (that's because in the latter case a new shell is started to execute your script).



Reply to: