UNIX for OpenVMS Users, Second Edition

You can assign variables in Bourne and Korn shell scripts with a statement that resembles a DCL symbol assignment. C shell scripts use the set command. Note the following differences in assigning values to variables and returning variable values between shell scripts and DCL command procedures:
The C shell does not make the same distinction as OpenVMS between defining variables for the duration of the command procedure and defining variables for the duration of the terminal session (that is, globally). The set command always assigns variables for the current process. Including the variable assignment in the .cshrc file gives the equivalent of global definitions, because this file is usually executed each time a shell (process) is started (that is, for each command or script file executed). The exception, as noted above, is a fast start of the C shell. You can use the C shell setenv command to set environmental variables.
The Korn shell does distinguish between variables local to a script or shell and those which are accessible to child processes. You may use the export command or an equivalent Korn shell option to make variables accessible.
The C shell makes no distinction in defining a shell variable as an integer or a text string (compare the OpenVMS = and :=, for example). In the Korn shell, all variables are string variables (even if the string happens to look like an integer) unless explicitly declared as integer variables using...