GNU Info

Info Node: (zsh.info)Word Designators

(zsh.info)Word Designators


Next: Modifiers Prev: Event Designators Up: History Expansion
Enter node , (file) or (file)node

Word Designators
----------------

A word designator indicates which word or words of a given command line
are to be included in a history reference.  A `:' usually separates the
event specification from the word designator.  It may be omitted only
if the word designator begins with a `^', `$', `*', `-' or `%'.  Word
designators include:

0
     The first input word (command).

N
     The Nth 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; X defaults to 0.

*
     All the arguments, or a null value if there are none.

X*
     Abbreviates `X-$'.

X-
     Like `X*' but omitting word $.

Note that a `%' word designator works only when used in one of `!%',
`!:%' or `!?STR?:%', and only when used after a !? expansion (possibly
in an earlier command).  Anything else results in an error, although
the error may not be the most obvious one.


automatically generated by info2www version 1.2.2.9