Brevis esse laboro, Obscurus fio -- I strive to be brief, and I become obscure.     CEE UCL HelpDesk Homepage

Department of Civil and Environmental Engineering
Frank Batten College of Engineering and Technology
Old Dominion University
Norfolk, Virginia 23529-0241, USA
Tel) (757) 683-3753
Fax) (757) 683-5354


	
Return to CEE UCL HelpDesk Homepage
CEE UCL HelpDesk Access Counter
 
How are shell variables assigned?


  
For shells from the C shell category (tcsh and csh), you can use "set variable=value" form to assign variables local to the shell,

$ set variable_one=9999

and "setenv variable value" for environment variables. For example, DISPLAY environmental variable can be defined using

$ setenv DISPLAY sparky:0

For C shell category (tcsh and csh), you can get rid of defined or exisitng variables in local shell by using

$ unset variable_one

and you can also get rid of defined or exisitng environmental variables by using

$ unsetenv DISPLAY

For shells from the Bourne shell category (bash, zsh and sh), you can use "variable=value" form to assign variables local to the shell,

$ variable_two=9999

and to place the variable into the environment simply by using "export"

$ export DISPLAY=sparky:0

To get rid of defined or exisitng (environmental) variables, use

$ unset <variable>

For further details, RTFM on "set", "setenv", "unset", "unsetenv" and "exort".

Return to CEE UCL HelpDesk Homepage Move to the Top of this page