summaryrefslogtreecommitdiff
path: root/devdocs/bash/event-designators.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/bash/event-designators.html
new repository
Diffstat (limited to 'devdocs/bash/event-designators.html')
-rw-r--r--devdocs/bash/event-designators.html14
1 files changed, 14 insertions, 0 deletions
diff --git a/devdocs/bash/event-designators.html b/devdocs/bash/event-designators.html
new file mode 100644
index 00000000..b5f38cbb
--- /dev/null
+++ b/devdocs/bash/event-designators.html
@@ -0,0 +1,14 @@
+<h1 class="subsection">Event Designators</h1> <p>An event designator is a reference to a command line entry in the history list. Unless the reference is absolute, events are relative to the current position in the history list. </p> <dl compact> <dt><span><code>!</code></span></dt> <dd>
+<p>Start a history substitution, except when followed by a space, tab, the end of the line, ‘<samp>=</samp>’ or ‘<samp>(</samp>’ (when the <code>extglob</code> shell option is enabled using the <code>shopt</code> builtin). </p> </dd> <dt><span><code>!<var>n</var></code></span></dt> <dd>
+<p>Refer to command line <var>n</var>. </p> </dd> <dt><span><code>!-<var>n</var></code></span></dt> <dd>
+<p>Refer to the command <var>n</var> lines back. </p> </dd> <dt><span><code>!!</code></span></dt> <dd>
+<p>Refer to the previous command. This is a synonym for ‘<samp>!-1</samp>’. </p> </dd> <dt><span><code>!<var>string</var></code></span></dt> <dd>
+<p>Refer to the most recent command preceding the current position in the history list starting with <var>string</var>. </p> </dd> <dt><span><code>!?<var>string</var>[?]</code></span></dt> <dd>
+<p>Refer to the most recent command preceding the current position in the history list containing <var>string</var>. The trailing ‘<samp>?</samp>’ may be omitted if the <var>string</var> is followed immediately by a newline. If <var>string</var> is missing, the string from the most recent search is used; it is an error if there is no previous search string. </p> </dd> <dt><span><code>^<var>string1</var>^<var>string2</var>^</code></span></dt> <dd>
+<p>Quick Substitution. Repeat the last command, replacing <var>string1</var> with <var>string2</var>. Equivalent to <code>!!:s^<var>string1</var>^<var>string2</var>^</code>. </p> </dd> <dt><span><code>!#</code></span></dt> <dd>
+<p>The entire command line typed so far. </p> </dd> </dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br>Licensed under the GNU Free Documentation License.<br>
+ <a href="https://www.gnu.org/software/bash/manual/html_node/Event-Designators.html" class="_attribution-link">https://www.gnu.org/software/bash/manual/html_node/Event-Designators.html</a>
+ </p>
+</div>