Bash 검색 및 이전 명령 실행

Bash 검색 및 이전 명령 실행

~에 따르면O'Reily의 Bash Pocket Reference(40페이지)다음 명령은 다음을 포함하는 최신 명령을 실행합니다 string.

!?string[?]

위 명령을 실행하고 있지만 항상 돌아옵니다.

bash: !?string[?: event not found

어떻게 해야 하나요?

답변1

Bash 매뉴얼에서:

!?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.

이는 [?]후행이 ?선택 사항임을 의미합니다. 온라인 설명서의 대부분의 개요 섹션에서는 이 규칙을 사용합니다.

NAME
     ls – list directory contents

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

관련 정보