Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

Aliases and Functions” (page 56)
stty Settings” (page 56)
“Line and History Editing” (page 56)
Shell Start-Up Files
The start-up procedure for the OSS shell is the same as the procedure for a UNIX Korn shell. If the
shell is a login shell (the OSS shell is considered a login shell when the OSH utility is specified
with the -ls option or with no options), the commands in the following start-up files are executed:
/etc/profile (analogous to the /etc/.cshrc C shell file)
$HOME/.profile (analogous to the $HOME/.login C shell file)
If you use the OSH utility with the +ls option, the OSS shell is not a login shell. If you use the OSH
utility with the -p or -prog option, the +ls option is the default.
If you use the OSH utility without the -p or -prog option, the -ls option is the default option,
and the /bin/sh file is executed as a login shell.
Normally, /etc/profile and $HOME/.profile contain global modifications for your
environment, such as options, variables, stty settings, and alias and function settings.
Option Values
You can set and reset option values using the set built-in command with the -o option. These
values determine the way the shell operates in certain conditions. (Many of the option values are
equivalent to the C shell variables, such as ignoreof, noglob, and verbose.)
For example, the value of the noclobber option specifies the action the shell should take when
a user causes output to be redirected to an existing file using the right angle bracket (>). When
noclobber is set to OFF, the command is aborted; when set to ON, the file is overwritten. The
following table lists the more frequently used -o option settings:
Description-o Option Setting
Displays values of all option settings.set -o
Turns on noclobber mode; output redirection to an
existing file causes command to abort.
set -o noclobber
Turns off emacs editing mode.set +o emacs
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 Variable
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
The OSS User Environment 55