Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
either by setting one of the vi, emacs, or gmacs options with the set command, or by setting
the VISUAL or EDITOR variables.
The following commands set options and variables for using the vi editing mode:
DescriptionEditing Command Setting
Ensures emacs mode is off.set +o emacs
Ensures gmacs mode is off.set +o gmacs
Turns on vi editing mode.set -o vi
Sets editing mode to vi. The whence command returns
the full pathname for the program vi. The value is exported
to subshells.
export EDITOR=$(whence vi)
FCEDIT
Use fc (the FIX command) to activate the second editing mode. In this mode, a temporary file is
created by the shell, and the editor specified by the FCEDIT variable is activated with this file.
When you exit the editor, the commands in the temporary file are executed by the shell. FCEDIT
is normally the ed utility. Most shells, including the OSS shell, provide the alias r (for repeat) to
reexecute a specific command in the history. The following sample command sets the editor for
fc to ed:
export FCEDIT=$(whence ed)
HISTSIZE and HISTFILE
Two other shell variables control the operation of the history mechanism: HISTSIZE and HISTFILE.
HISTSIZE specifies the number of commands stored in the history file. If HISTSIZE is not specified
in $HOME/.profile or is invalid, the default of 128 commands is used.
HISTFILE specifies the pathname of the file that the shell uses to store the command history. If
HISTFILE is not specified in $HOME/.profile or is invalid, the filename $HOME/.sh_history
is used. If you are using more than one OSS shell at a time, HISTFILE should be set to a different
filename for each shell to prevent shell interference.
The following example sets the number of commands saved in the history file to 50:
export HISTSIZE=50
The following example sets the pathname of the history file to be unique for this shell:
export HISTFILE=$HOME/.ksh_hist$$
The OSS process ID (PID) number is placed at the end of the filename, replacing the $$, thus
ensuring a unique pathname. The filename becomes $HOME/.ksh_histPID.
Guardian Environment Variables and the OSS Shell
When a new Guardian process starts, a sequence of messages usually provides that process with
some information about the process’s environment, such as the user-specified filenames used by
the process and other user-specified information in the form of the ASSIGN and PARAM environment
variables. This start-up sequence usually occurs whenever one process creates another; the creating
process sends the information to the new process, but it is up to the new process to somehow use
the information.
A DEFINE is a named set of attributes and values that you use to pass information to a process
before running it. DEFINEs remove the need to set up attributes each time a given process is
invoked: the attributes can be passed or retrieved simply by specifying the name of the DEFINE.
The OSS User Environment 57