Wednesday, August 8, 2012

How do you set variable accessible form sub shells?

This can be achieved by using "export" command. It marks the variable for automatic export to the environment of subsequently executed commands i.e. makes the local shell variable global or environmental. For example :

export PATH=$PATH:/usr/local/bin

will make PATH variable global.

To see the list of all exported variables and functions, type :

export -p

No comments :