The last set of commands, environment commands, modify the gsh environment. Many of these commands have been used in other parts of this manual and, therefore, should not be new.
Creates an alias for a string. When this alias is referenced as a command, value will be expanded into the command line. For commands that require many arguments or have several steps, you could set up an alias to save typing. You can also use aliases to create new names for commands. To obtain a list of all aliases, invoke alias with no arguments. To list the value of a specific alias, invoke alias with name only.
When a shell environment variable is marked as exportable, any process that is created from within the current process (most likely gsh), will be passed copies of the exported variables. See setenv and the Section called Scope of Shell Variables in the Chapter called Shell Variables.
Displays a list of all commands currently in the shell's hash table; i.e., a list of commands in the various $PATH directories.
GNO maintains a list of 32 'prefixes' for each process. Prefixes allow the user to reference a directory with a number. While gsh provides this ability with environment variables, the prefix command exists to support the ORCA compilers and other utilities that are dependent on certain GS/OS prefixes. the Appendix called Prefix Conventions contains a list of these prefixes and their "default" meanings, as documented in the "Apple IIgs GS/OS Reference".
If refixname is not given, then the value of prefixnum is displayed. If neither argument is given, a list of currently assigned prefixes is displayed.
To decrease the time spent searching for a command, gsh builds a hash table of all commands which were found in the pathnames set in the $PATH environment variable. When a command is invoked, only this list is searched. When the $PATH environment variable is changed, gsh must rebuild this list. The rehash command tells gsh to rebuild the list.
While the old list is still active, if $PATH is changed and one of the previous search paths is no longer online, gsh will try and execute the command from the offline device, resulting in a command failure.
Use these command to create or modify environment variables. If set is invoked with no arguments, a list of the current environment variables is displayed. If only var is given as an argument, the value of var is displayed. To set or reset a variable, use both the var and value arguments. There are two ways to set a variable, either by "var value", or by "var=value". To set multiple variables at once, simply list them all on the command line as shown above.
setenv works just like set, but automatically exports the variable(s) or lists only exported variables.
When using set or setenv to view a list of variables, exported variable names appear in all capital letters.
To remove an alias from the alias list, use this command. To remove multiple aliases with one command, specify all the aliases on the command line.
To disable the internal hash table created with the rehash command, use this command. This is useful if you wish to use only utilities in the current working directory (during testing, for example).
To remove a variable from the environment, use unset. unset accepts multiple names if more than one variable is to be deleted. Future attempts to access the variable var will result in an error or a NULL string, depending on the circumstances.