2.3.8. - Command Recall (History)
spec standard
history
feature lets you recall previous commands.
(
spec is usually installed with the optional GNU readline
history library, at the spec administrator's option.
With the readline library, the history syntax is
greatly expanded. In addition, features such as command-line editing,
command
completion and tilde expansion become available.
See the on-line readline help file for detailed information.
)
Examples of the recognized syntax are:
!! |
Redo the previous command. |
!14 |
Redo command number 14. |
!-2 |
Redo the second to previous command. |
!asc |
Redo the last command that began with asc. |
!asc -10000 |
As above and append -10000 to the command. |
| |
history |
List the last 1000 commands. |
history N |
List the last N commands. |
history -N |
List the last N commands in reverse order. |
The command number is prepended to the
spec
prompt as an aid in
using the history feature.
Only commands typed at the keyboard are remembered for history,
and no more than 1000 commands are retained.
The history feature cannot be used in command files.
Command recall must occur at the beginning of a line,
although initial white space is allowed.
Text may follow the command-recall word to extend
that command.
Appending
:s/left/right/ to a recalled command will modify the first occurrence of
the string
left in the recalled command to the characters
right. The delimiter of the left and right strings may be any character.
The final delimiter is optional.
If
left is empty, the last entered left string is used as the pattern to match.
In addition,
^left^right^ at the start of a line is shorthand for
!-1:s/left/right/. In this case, the circumflex (
^) must be used as the delimiter.
The final delimiter is optional.
The history is saved in the state file
when exiting spec.
Restarting spec
reads in the saved history from the state file.
|