>jlevie Wrote:
>The difficulty here is that env variables are only inherited from the parent shell. Your script is working correctly and in the shell >that is executing the script and in any shells that the script might start the variable will exist. It won't, however, exist in the >shell you use to execute the script.
I still don't understand why it is. especially , "Your script is working correctly and *** in the shell that is executing the script and in any shells that the script might start the variable will exist. It won't, however, exist in the shell you use to execute the script.***"
>If you want the variable to exist in your login shell you need to place the definition in the shell init script in your home directory
>(.bashrc, .cshrc, etc) or define it on the command line.
I have a try with rc (/etc/rc), but it seemed no useful. i think rc will be executed when system startup. but why the env variable, I set in the rc, is still not useful.
now i will have a try with .bashrc.
----- lr
Main Topics
Browse All Topics





by: jleviePosted on 2003-06-12 at 20:58:14ID: 8714635
The difficulty here is that env variables are only inherited from the parent shell. Your script is working correctly and in the shell that is executing the script and in any shells that the script might start the variable will exist. It won't, however, exist in the shell you use to execute the script.
If you want the variable to exist in your login shell you need to place the definition in the shell init script in your home directory (.bashrc, .cshrc, etc) or define it on the command line.