2

According to O'Reily's Bash Pocket Reference (page 40) the following will run the most recent command that contains string:

!?string[?]

I'm running said command but I always get back:

bash: !?string[?: event not found

How can I do this?

1 Answer 1

3

From the Bash manual:

!?string[?]
     Refer to the most recent command preceding the current position
     in the history list containing string.  The trailing ? may be
     omitted if string is followed immediately by a newline.

The [?] means that the trailing ? is optional. You will find this convention used in most synopsis sections in the on-line manuals, for example

NAME
     ls – list directory contents

SYNOPSIS
     ls [-1AaCcdFfgHhikLlmnopqRrSsTtux] [file ...]

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.