User defined variables are local to the current shell, and are defined by the user (as the name states). To set a user defined variable, the user would use the set command which has the following syntax for assigning a value to a variable:
% set MY_ADDRESSemail@example.com'' % echo ``E-mail me at $MY_ADDRESS'' E-mail me at firstname.lastname@example.org
To see a listing of all of the currently set variables (both local and global), the set command can be used with no arguments. For example, a typical session might give the following:
% set MY_ADDRESS email@example.com cdpath /usr/spool cwd /home/buchanan/book/cshell history 40 home /home/buchanan path (/bin /usr/bin /usr/local/bin usr/X11/bin .) prompt2 %m:%# shell /bin/csh user /buchanan
All of the lower cased variables are environmental variables that will
be covered shortly.
To remove a variable from use, the
unset command can be used.
unset command followed by a name (or wildcard expression)
will remove the variable(s).