MPE/iX Shell and Utilities Reference Manual, Vol 1

fc(1) MPE/iX Shell and Utilities fc(1)
NAME
fc — display, fix, edit and re-enter previous commands
SYNOPSIS
fc [–r][–e editor][first [last]]
fc –l [–nr][first [last]]
fc –s [old=new][specifier]
DESCRIPTION
fc displays, edits, and re-enters commands which have been input to an interactive shell. fc
stands for fix commands. The environment variable
HISTSIZE
contains the number of com-
mands that are accessible. If
HISTSIZE
is not defined, 128 commands are accessible.
The shell stores these commands in a history file. When the
HISTFILE
environment variable
is defined as the name of a writable file, the shell uses this as the history file; otherwise, the
history file is $HOME/.sh_history,if
HOME
is defined and the file is writable. If the
HOME
variable is not defined, or the file is not writable, the shell attempts to create a tempo-
rary file for the history. If a temporary file cannot be created, the shell does not keep a history
file.
Note: A shell shares history (commands) with all shells that have the same history file. A
login shell truncates the history file if it is more than
HISTSIZE
lines long.
Normally, the shell does not keep a history of commands executed from a profile file or the
ENV
file. By default, however, it begins recording commands in the history file when it
encounters a function definition in either of these set-up files. This means that the
HISTSIZE
and
HISTFILE
variables must be set up appropriately before the first function definition. If
you do not want the history file to begin at this time, use
set -o nolog
For further information, see sh(1) and set(1).
Any variable assignment or redirection that appears on the fc command line affects both the
fc command itself and the commands that fc produces.
The first form of fc in the SYNOPSIS section puts you into an editor with a range of com-
mands to edit. When you leave the editor, fc inputs the edited commands to the shell.
The first and last command in the range are specified with first and last. There are three ways
to specify a command.
(a) If the command specifier is an unsigned or positive number, fc edits the command with
that number.
1-224 Commands and Utilities