blob: 47362f5681c876c3479f7dcef53e61cf4d19f8cd [file] [log] [blame]
<html lang="en">
<head>
<title>Event Designators - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="History-Interaction.html#History-Interaction" title="History Interaction">
<link rel="next" href="Word-Designators.html#Word-Designators" title="Word Designators">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Free Software'' and ``Free Software Needs
Free Documentation'', with the Front-Cover Texts being ``A GNU Manual,''
and with the Back-Cover Texts as in (a) below.
(a) The FSF's Back-Cover Text is: ``You are free to copy and modify
this GNU Manual. Buying copies from GNU Press supports the FSF in
developing GNU and promoting software freedom.''
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Event-Designators"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Word-Designators.html#Word-Designators">Word Designators</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="History-Interaction.html#History-Interaction">History Interaction</a>
<hr>
</div>
<h4 class="subsection">33.1.1 Event Designators</h4>
<p><a name="index-event-designators-3294"></a>
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.
<a name="index-history-events-3295"></a>
<dl>
<dt><code>!</code><dd>Start a history substitution, except when followed by a space, tab,
the end of the line, or &lsquo;<samp><span class="samp">=</span></samp>&rsquo;.
<br><dt><code>!</code><var>n</var><dd>Refer to command line <var>n</var>.
<br><dt><code>!-</code><var>n</var><dd>Refer to the command <var>n</var> lines back.
<br><dt><code>!!</code><dd>Refer to the previous command. This is a synonym for &lsquo;<samp><span class="samp">!-1</span></samp>&rsquo;.
<br><dt><code>!</code><var>string</var><dd>Refer to the most recent command
preceding the current position in the history list
starting with <var>string</var>.
<br><dt><code>!?</code><var>string</var><code>[?]</code><dd>Refer to the most recent command
preceding the current position in the history list
containing <var>string</var>.
The trailing
&lsquo;<samp><span class="samp">?</span></samp>&rsquo; may be omitted if the <var>string</var> is followed immediately by
a newline.
<br><dt><code>^</code><var>string1</var><code>^</code><var>string2</var><code>^</code><dd>Quick Substitution. Repeat the last command, replacing <var>string1</var>
with <var>string2</var>. Equivalent to
<code>!!:s/</code><var>string1</var><code>/</code><var>string2</var><code>/</code>.
<br><dt><code>!#</code><dd>The entire command line typed so far.
</dl>
</body></html>