UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: falseChapter 4
The Bourne Shell and Korn Shell
Next: Reference: fg
 

fc

fc [options] [first [last]]
fc  -e  - [old=new] [command]

Korn shell only. Display or edit commands in the history list. (Use only one of -l or -e.) fc provides capabilities similar to the C shell's history and ! syntax. first and last are numbers or strings specifying the range of commands to display or edit. If last is omitted, fc applies to a single command (specified by first). If both first and last are omitted, fc edits the previous command or lists the last 16. The second form of fc takes a history command, replaces old string with new string, and executes the modified command. If no strings are specified, command is just re-executed. If no command is given either, the previous command is re-executed. command is a number or string like first. See examples under "Command History."

Options

-e [editor]

Invoke editor to edit the specified history commands. The default editor is set by shell variable FCEDIT.

-e -

Execute (or redo) a history command; refer to second syntax line above.

-l

List the specified command or range of commands, or list the last 16.

-n

Suppress command numbering from the -l listing.

-r

Reverse the order of the -l listing.


Previous: Reference: falseUNIX in a Nutshell: System V EditionNext: Reference: fg
Reference: falseBook IndexReference: fg

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System