Environmental variables hold numbers and character strings and are typically used to customise the way the system works. For example, the variable PATH contains a list of all the directories the system should search when looking for a program file that matches the commands you type. By convention, environmental variables have names that are all upper case. To create the variable MYVAR, store the character string ``abc'' in it, print it out, and then delete it again, from the Bourne shell:-
MYVAR="abc"To do the same thing from the C shell:-
export MYVAR
echo $MYVAR
unset MYVAR
setenv MYVAR "abc"To list all the current variables, from either shell, type:-
printenv MYVAR
unsetenv MYVAR
envOnce created, an environmental variable persists until you delete it or logout. Any process you run, will see the same variables, which is normally what you want i.e. that all you jobs see the same customised environment.