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".