View Single Post
  #2   (View Single Post)  
Old 22nd May 2013
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,128
Default

Code:
# monkey=chimpansee
# set | grep monkey
monkey=chimpansee

# sh
# set | grep monkey
# 
# exit

# set | grep monkey 
monkey=chimpansee

# export monkey
# sh
# set | grep monkey
monkey=chimpansee
Conclusion: a shell variable is only visible to that particular shell instance/process. If you start a new process/subshell, it will not inherit the shell variables of the parent shell/process unless the variable has been exported (Bourne shell) into the environment.

For the C shell you have to use setenv instead of export
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote