fc - list or edit command history.
fc [-r] [-e editor] [first [last]] fc -l [-nr] [first [last]] fc -s [old=new] [first]
fc is a POSIX regular builtin provided by Rush. It lists, edits, or re-executes interactive command history.
fc -l lists history entries. -n suppresses command numbers and -r reverses the selected range. History selectors may be command numbers, negative offsets such as -1, or command prefixes.
fc -s re-executes one selected entry without invoking an editor. If old=new is present, the first occurrence of old in the selected command is replaced before execution. The re-executed command is appended to history; the fc invocation itself is not.
The editor form, fc [-r] [-e editor] [first [last]], writes the selected command range to a temporary file, invokes the selected editor, and then re-executes the edited contents. -r reverses the selected range before editing. If -e is omitted, FCEDIT selects the editor; if FCEDIT is unset or null, Rush uses ed.
See the POSIX definition for command-specific status rules. Usage errors generally return a non-zero status.
rush-builtins(7), POSIX Shell Command Language.