Previous: Word Designators, Up: History Interaction [Contents][Index]
After the optional word designator, you can add a sequence of one or more of the following modifiers, each preceded by a ‘:’. These modify, or edit, the word or words selected from the history event.
hRemove a trailing pathname component, leaving only the head.
tRemove all leading pathname components, leaving the tail.
rRemove a trailing suffix of the form ‘.suffix’, leaving the basename.
eRemove all but the trailing suffix.
pPrint the new command but do not execute it.
s/old/new/Substitute new for the first occurrence of old in the
event line.
Any character may be used as the delimiter in place of ‘/’.
The delimiter may be quoted in old and new
with a single backslash. If ‘&’ appears in new,
it is replaced by old. A single backslash will quote
the ‘&’.
If old is null, it is set to the last old
substituted, or, if no previous history substitutions took place,
the last string
in a !?string[?]
search.
If new is is null, each matching old is deleted.
The final delimiter is optional if it is the last
character on the input line.
&Repeat the previous substitution.
gaCause changes to be applied over the entire event line. Used in
conjunction with ‘s’, as in gs/old/new/,
or with ‘&’.
GApply the following ‘s’ or ‘&’ modifier once to each word in the event.