[ILUG] ILUG Why Can't Shell Scripts Export Variables
kosullivan_xlib Last Name
kosullivan_xlib at my-deja.com
Wed Jan 31 10:51:17 GMT 2001
I read that a C progrma can't export its environment variables to the shell however I was sure that a shell script would be able to do so so I wrote the following to find out.
#!/bin/sh
export PATH=$HOME/bin:$PATH
echo $PATH
The path appears fine until you type the echo $PATH at the prompt where you get the path which you always had and none of the stuff in the script is in the path.
Why is this aren't shell scripts just a collection of shell commands in a file and if it works at the prompt shouldn't it work in a script tes same way.
/bin/sh is a link to bash and my shell is bash.
------------------------------------------------------------
--== Sent via Deja.com ==--
http://www.deja.com/
More information about the ILUG
mailing list