The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
typeset and export command difference systemsb UNIX for Dummies Questions & Answers 0 05-16-2006 08:36 AM
difference between set and export shriashishpatil UNIX for Dummies Questions & Answers 1 02-22-2006 10:28 AM
Difference between SET and SETENV 435 Gavea UNIX for Dummies Questions & Answers 2 11-10-2003 06:07 PM
What 's setenv? myoeminn Shell Programming and Scripting 2 03-05-2002 06:24 PM
set, setenv w6u6f UNIX for Dummies Questions & Answers 1 01-31-2002 01:58 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 02-06-2008
Registered User
 

Join Date: Feb 2008
Posts: 2
difference between EXPORT and setenv

Hi,

Is there any difference between setting an environment variable by EXPORT and by setenv?
Reply With Quote
Forum Sponsor
  #2  
Old 02-06-2008
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,683
Quote:
Originally Posted by dexkid View Post
Hi,

Is there any difference between setting an environment variable by EXPORT and by setenv?
export and not EXPORT is used by sh and ksh shells. setenv is used by csh.

The syntax also differs for both.

Code:
export key=value
setenv key value
Reply With Quote
  #3  
Old 02-06-2008
Registered User
 

Join Date: Feb 2008
Posts: 2
Can environmental variables exported using export and setenv be accessible across different terminals?
Also do they persist for accessing via programs using "getenv()" call ?
Reply With Quote
  #4  
Old 02-07-2008
HPAVC's Avatar
Registered User
 

Join Date: Feb 2008
Posts: 105
No there isn't a shared realtime environment in multiple shell sessions.

Typically you would setup some sort of profile to kick start the environment that is full of the variables (~/.profile, ~/.bashrc, ~/.tcshrc, etc) just like as well as employ the system wide equivalent /etc/profile and what not.

But not there isnt a: super_export TERM=vt100 that will force that variable to be inherited by all your running shells immediately.

The export and setenv calls typically are used for other programs or sub programs to use and shouldn't be confused with the 'set' variables in some shell scripts that are local for that shell sessions. Or that programs will set for themselves and their sub programs but will disappear when the program ends.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:50 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0