Environment variables
With general availability of networking cards for the Amiga, the use of environment variables is sure to increase. Environment variables are basically places where information can be stored; they are similar to logical assignments in that a variable text string is given a generic label. For example, in the Shell, the user can type:
echo $workbench
and be presented with the current version in use. Environment variables are set by the user with the SetEnv command of AmigaDOS.
Store your variables in a subdirectory such as ENV:<basename>/variables. Only user-defined and standard system variables should go in ENV:. ENV:Sys/ is reserved for system functions.
Here are some recommended environment variable names currently in use in the system. Note: they are not case-sensitive.
workbench | The version of Workbench |
kickstart | The version of Kickstart |
hostname | Contains the machine name |
username | Contains the login name of the current user of the machine |
editor | Sets the preferred text editor |
The following are local variables provided by the Shell. These are most relevant to applications that use DOS scripts. Of course you should avoid using these names for your variables since they are set automatically by the Shell.
process | The process number |
RC | The primary return code of the last command run |
Result2 | The secondary return code of the last command run |