history: Word Designators
1
1 1.1.2 Word Designators
1 ----------------------
1
1 Word designators are used to select desired words from the event. A ':'
1 separates the event specification from the word designator. It may be
1 omitted if the word designator begins with a '^', '$', '*', '-', or '%'.
1 Words are numbered from the beginning of the line, with the first word
1 being denoted by 0 (zero). Words are inserted into the current line
1 separated by single spaces.
1
1 For example,
1
1 '!!'
1 designates the preceding command. When you type this, the
1 preceding command is repeated in toto.
1
1 '!!:$'
1 designates the last argument of the preceding command. This may be
1 shortened to '!$'.
1
1 '!fi:2'
1 designates the second argument of the most recent command starting
1 with the letters 'fi'.
1
1 Here are the word designators:
1
1 '0 (zero)'
1 The '0'th word. For many applications, this is the command word.
1
1 'N'
1 The Nth word.
1
1 '^'
1 The first argument; that is, word 1.
1
1 '$'
1 The last argument.
1
1 '%'
1 The word matched by the most recent '?STRING?' search.
1
1 'X-Y'
1 A range of words; '-Y' abbreviates '0-Y'.
1
1 '*'
1 All of the words, except the '0'th. This is a synonym for '1-$'.
1 It is not an error to use '*' if there is just one word in the
1 event; the empty string is returned in that case.
1
1 'X*'
1 Abbreviates 'X-$'
1
1 'X-'
1 Abbreviates 'X-$' like 'X*', but omits the last word.
1
1 If a word designator is supplied without an event specification, the
1 previous command is used as the event.
1