Command Reference Guide

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/!!!intro.1
________________________________________________________________
___ ___
c
csh(1) csh(1)
These forms, without further modification, simply reintroduce the words of the specified events, each
separated by a single blank. As a special case, !! is a re-do; it refers to the previous command.
To select words from a command, use a colon (:) and a designator for the desired words after the event
specification. The words of an input line are numbered from zero. The basic word designators are:
0 First word (i.e., the command name itself).
nnth word.
^ First argument. (This is equivalent to 1.)
$ Last word.
a-b Range of words from a through b. Special cases are -y, an abbreviation for ‘‘word 0 through
word y’’; and x-, which means ‘‘word x up to, but not including, word $’’.
* Range from the second word through the last word.
% Used with a search sequence to substitutethe immediately preceding matching word.
The colon separating the command specification from the word designator can be omitted if the argument
selector begins with a ˆ, $,
*, -,or%.
After word designator can be followed by a sequence of modifiers, each preceded by a colon. The following
modifiers are defined:
h Use only the first component of a path name by removing all following components.
r Use the root file name by removing any trailing suffix (.xxx).
e Use the file name’s trailing suffix (.xxx
) by removing the root name.
s/l/r
substitute the value of r for the value l in the indicated command.
t Use only the final file name of a path name by removing all leading path name components.
& Repeat the previous substitution.
p Print the new command but do not execute it.
q Quote the substituted words, preventing further substitutions.
x Like q, but break into words at blanks, tabs and newlines.
g Use a global command as a prefix to another modifier to cause the specified change to be made
globally. All words in the command are changed, one change per word, and each string enclosed
in single quotes (’) or double quotes (" ) is treated as a single word.
Unless preceded by a g, the modification is applied only to the first modifiable word. An error results if a
substitution is attempted and cannot be completed (i.e., if you ask for a substitution of !11 on a history
buffer containing only 10 commands).
The left hand side of substitutions are strings; not regular expressions in the sense of HP-UX editors. Any
character can be used as the delimiter in place of a slash (/). Use a backslash to quote a delimiter character
if it is used in the l or r string. The character & in the right-hand side is replaced by the text from the left.
A \ also quotes &. A null l string uses the previous string either from an l or from a contextual scan string
s in
!?s?. The trailing delimiter in the substitution can be omitted if a new-line character follows immedi-
ately, as may the trailing ? in a contextual scan.
A history reference can be given without an event specification (as in !$). In this case, the reference is to
the previous command unless a previous history reference occurred on the same line, in which case this
form repeats the previous reference. Thus
!?foo?ˆ !$
gives the first and last arguments from the command matching ?foo?.
A special abbreviation of a history reference occurs when the first non-blank character of an input line is a
circumflex (ˆ). This is equivalent to !:sˆ, providing a convenient shorthand for substitutions on the text of
the previous line. Thus ˆlbˆlib fixes the spelling of lib in the previous command.
Finally, a history substitution can be enclosed within curly braces {}if necessary to insulate it from the
characters which follow. Thus, after
HP-UX Release 11i: December 2000 − 9 − Section 1−−137
___
___