Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
Interoperating Between User Environments
Open System Services Porting Guide520573-006
4-6
Factors Affecting Shell Operation
to ON, the file is overwritten. The following table lists the more frequently used
-o option settings:
If you wish to display the names and values of the current parameter settings, use the
set command with no arguments. The set command with only the plus sign (+)
argument displays the names of all named parameters.
Variable Values
OSS shell variables are set using a command line that first has the variable name,
followed by an equal sign (=) and the value for the variable named. The PATH and PSn
variables are featured following.
PATH
The most important variable affecting shell operation is PATH. It is used by the OSS
shell as it is used by the Bourne and C shells: that is, to specify the directories and the
directory order that your system uses to search for, find, and execute commands. The
following sample command adds the current directory and the user’s $HOME directory
to the beginning of the program search path:
PATH=.:$HOME:$PATH
PSn
The PSn variables determine the prompts used by the OSS shell. n is either 1 or 2,
specifying the primary or secondary prompt string. The default for PS1 is the dollar sign
($); the default for PS2 is the right angle bracket (>) followed by a blank space.
The following sample command sets the prompt to contain the user's name, the
system name, the current directory, and the current line number:
PS1=$LOGNAME@(uname -n):'$PWD'[\!]
If the user name is the super ID, the system name is OSS, and the current directory is
/bin, the prompt would look like the following:
SUPER.SUPER@OSS:/bin[21]
Aliases and Functions
Aliases allow the OSS shell to perform command-name or abbreviation substitutions.
The value of the current shell aliases can be printed using the alias command with
no arguments.
-o Option Setting Description
set -o Displays values of all option settings.
set -o noclobber Turns on noclobber mode; output redirection to an existing file
causes command to abort.
set +o emacs Turns off emacs editing mode.