February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Allows the user to fix previously executed commands through command-line editing.
Syntax
fc [-r] [-e editor] [first [last]] fc -l [-nr] [first [last]] fc -s [old=new] [command ]
Options
-r reverses the search order.
-e enables you to choose a different editor (the default is ed).
-l lists previous commands.
-n does not display command numbers for previous commands.
-s substitutes new for old in the command (old is the old string to be replaced by the new string).
Oddities
Typically performed using a command-line editor.
The history command is an alias for fc: history='fc -l'.
The r command (recall) is an alias for fc: r='fc -e -'.
Example
$ fc -l 1412 print $myvar 1413 ksh 1414 print $myvar 1415 exit 1416 print $myvar ...
Read now
Unlock full access