LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can all shells read all environmental variables set by other shells? (http://www.linuxquestions.org/questions/linux-newbie-8/can-all-shells-read-all-environmental-variables-set-by-other-shells-821749/)

carlodelmundo 07-23-2010 01:20 PM

Can all shells read all environmental variables set by other shells?
 
For example, if I'm in csh, I can use `setenv VARNAME varVALUE` while I can use export in Bash.

Given that the environmental variables are created, can BASH read env vars from csh and vice versa?

unSpawn 07-23-2010 01:51 PM

You can test this yourself:
Code:

~]$ csh
 ~]$ setenv VARNAME varVALUE
 ~]$ bash
 ~]$ env|grep VARNAME
VARNAME=varVALUE

Sub-shells only though if not using ~/.profile and such.

carlodelmundo 07-23-2010 02:03 PM

Thanks the shells can read each other's env vars


All times are GMT -5. The time now is 03:25 AM.