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

Table Of Contents
Interoperating Between User Environments
Open System Services Porting Guide520573-006
4-8
Guardian Environment Variables and the OSS Shell
The following commands set options and variables for using the vi editing mode:
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-
Editing Command Setting Description
set +o emacs Ensures emacs mode is off.
set +o gmacs Ensures gmacs mode is off.
set -o vi Turns on vi editing mode.
export EDITOR=$(whence vi) Sets editing mode to vi. The whence command
returns the full pathname for the program vi. The
value is exported to subshells.