* v850-dis.c (disassemble): Handle insertion of ',', '[' and
[deliverable/binutils-gdb.git] / readline / doc / hsuser.texinfo
CommitLineData
be9485d5
SG
1@ignore
2This file documents the user interface to the GNU History library.
3
4Copyright (C) 1988, 1991 Free Software Foundation, Inc.
5Authored by Brian Fox.
6
7Permission is granted to make and distribute verbatim copies of this manual
8provided the copyright notice and this permission notice are preserved on
9all copies.
10
11Permission is granted to process this file through Tex and print the
12results, provided the printed document carries copying permission notice
13identical to this one except for the removal of this paragraph (this
14paragraph not being relevant to the printed manual).
15
16Permission is granted to copy and distribute modified versions of this
17manual under the conditions for verbatim copying, provided also that the
18GNU Copyright statement is available to the distributee, and provided that
19the entire resulting derived work is distributed under the terms of a
20permission notice identical to this one.
21
22Permission is granted to copy and distribute translations of this manual
23into another language, under the above conditions for modified versions.
24@end ignore
25
26@node Using History Interactively
27@chapter Using History Interactively
28
29This chapter describes how to use the GNU History Library interactively,
30from a user's standpoint. It should be considered a user's guide. For
31information on using the GNU History Library in your own programs,
32@pxref{Programming with GNU History}.
33
34@menu
35* History Interaction:: What it feels like using History as a user.
36@end menu
37
38@node History Interaction
39@section History Interaction
40@cindex expansion
41
42The History library provides a history expansion feature that is similar
43to the history expansion in Csh. The following text describes the sytax
44that you use to manipulate the history information.
45
46History expansion takes place in two parts. The first is to determine
47which line from the previous history should be used during substitution.
48The second is to select portions of that line for inclusion into the
49current one. The line selected from the previous history is called the
50@dfn{event}, and the portions of that line that are acted upon are
51called @dfn{words}. The line is broken into words in the same fashion
52that the Bash shell does, so that several English (or Unix) words
53surrounded by quotes are considered as one word.
54
55@menu
56* Event Designators:: How to specify which history line to use.
57* Word Designators:: Specifying which words are of interest.
58* Modifiers:: Modifying the results of susbstitution.
59@end menu
60
61@node Event Designators
62@subsection Event Designators
63@cindex event designators
64
65An event designator is a reference to a command line entry in the
66history list.
67
68@table @asis
69
70@item @code{!}
71Start a history subsititution, except when followed by a space, tab, or
72the end of the line... @key{=} or @key{(}.
73
74@item @code{!!}
75Refer to the previous command. This is a synonym for @code{!-1}.
76
77@item @code{!n}
78Refer to command line @var{n}.
79
80@item @code{!-n}
81Refer to the command line @var{n} lines back.
82
83@item @code{!string}
84Refer to the most recent command starting with @var{string}.
85
86@item @code{!?string}[@code{?}]
87Refer to the most recent command containing @var{string}.
88
89@end table
90
91@node Word Designators
92@subsection Word Designators
93
94A @key{:} separates the event specification from the word designator. It
95can be omitted if the word designator begins with a @key{^}, @key{$},
96@key{*} or @key{%}. Words are numbered from the beginning of the line,
97with the first word being denoted by a 0 (zero).
98
99@table @code
100
101@item 0 (zero)
102The zero'th word. For many applications, this is the command word.
103
104@item n
105The @var{n}'th word.
106
107@item ^
108The first argument. that is, word 1.
109
110@item $
111The last argument.
112
113@item %
114The word matched by the most recent @code{?string?} search.
115
116@item x-y
117A range of words; @code{-@var{y}} Abbreviates @code{0-@var{y}}.
118
119@item *
120All of the words, excepting the zero'th. This is a synonym for @code{1-$}.
121It is not an error to use @key{*} if there is just one word in the event.
122The empty string is returned in that case.
123
124@end table
125
126@node Modifiers
127@subsection Modifiers
128
129After the optional word designator, you can add a sequence of one or more
130of the following modifiers, each preceded by a @key{:}.
131
132@table @code
133
134@item #
135The entire command line typed so far. This means the current command,
136not the previous command, so it really isn't a word designator, and doesn't
137belong in this section.
138
139@item h
140Remove a trailing pathname component, leaving only the head.
141
142@item r
143Remove a trailing suffix of the form @samp{.}@var{suffix}, leaving the basename.
144
145@item e
146Remove all but the suffix.
147
148@item t
149Remove all leading pathname components, leaving the tail.
150
151@item p
152Print the new command but do not execute it.
153@end table
This page took 0.170383 seconds and 4 git commands to generate.