I am working though Daniel Robbins bash by example series and have a problem with Part 2
at the command line I type:
which, as expected, returns:
However when i create a file called myscript.sh containing the following:
I get nothing.
I am using Suse 9.2 and have also tried the same on an 8.2 box.
What am I doing wrong?
Re: bash problem2005-01-27T14:16:23ZThis is the accepted answer. This is the accepted answer.When you run the shell script, it starts a new instance of bash, and does not pick up on the "myvar" which is only valid in the current shell session. Try:
The export should allow the shell script to pick up the variable.