LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-23-2010, 01:20 PM   #1
carlodelmundo
LQ Newbie
 
Registered: Dec 2009
Posts: 6

Rep: Reputation: 0
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?
 
Old 07-23-2010, 01:51 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,457
Blog Entries: 54

Rep: Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897
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.
 
1 members found this post helpful.
Old 07-23-2010, 02:03 PM   #3
carlodelmundo
LQ Newbie
 
Registered: Dec 2009
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks the shells can read each other's env vars
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to read $PS1 on non-login shells? sombragris Slackware 5 06-07-2010 12:26 PM
How are variables set for interactive shells? Josh000 Slackware 22 05-07-2010 12:19 AM
How can I set environmental variables of vi editor in ROOT user? sbnice Linux - General 2 12-18-2006 10:24 PM
help on the different shells... JoannesX Programming 2 02-06-2005 11:07 AM
how to set environmental variables chakkerz Linux - Newbie 8 07-01-2004 03:06 AM


All times are GMT -5. The time now is 07:10 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration