Table of Contents
SIGNALS
The INT and QUIT signals for an invoked command are ignored if the
command is followed by & and the job MONITOR option is
not active. Otherwise, signals have the values inherited by the shell
from its parent (but see the TRAPxxx special function
above).
HISTORY
History substitution allows you to use words from previous command
lines in the command line you are typing. This simplifies spelling
corrections and the repetition of complicated commands or
arguments. Command lines are saved in the history list, the size of
which is controlled by the HISTSIZE variable. The most
recent command is retained in any case. A history substitution begins
with a ! and may occur anywhere on the command line; history
substitutions do not nest. The ! can be escaped with \
to suppress its special meaning. Single or double quotes will
not work for this.
Input lines containing history substitutions are echoed on the
terminal after being expanded, but before any other substitutions take
place or the command gets executed.
Event Designators
An event designator is a reference to a command-line entry in the
history list.
- !
-
Start a history substitution, except when followed by a blank,
newline, =, or (.
- !!
-
Refer to the previous command. By itself, this substitution repeats
the previous command.
- !n
-
Refer to command-line n.
- !-n
-
Refer to the current command-line minus n.
- !str
-
Refer to the most recent command starting with str.
- !?str[?]
-
Refer to the most recent command containing str.
- !#
-
Refer to the current command line typed in so far.
- !{...}
-
Insulate a history reference from adjacent characters (if necessary).
Word Designators
A word designator indicates which word or words of a given command
line will be included in a history reference. A `:' separates
the event specification from the word designator. It can be omitted if
the word designator begins with a ^, $, *,
- or %. Word designators include:
- 0
- The first input word (command).
- n
- The n'th argument.
- ^
- The first argument, that is, 1.
- $
- The last argument.
- %
- The word matched by (the most recent) ?str search.
- x-y
- A range of words; -y abbreviates 0-y.
- *
-
All the arguments, or a null value if there is just one word in the event.
- x*
- Abbreviates x-$.
- x-
-
Like x* but omitting word $. Note that a `%' word
designator will only work when used as !%, !:%,
!?str?:% and only when used after a !? substitution. Anything
else will result in an error, although the error may not be the most
obvious one.
Mark D. Borges