Bash 명령 매뉴얼에 -e 옵션이 없는 이유는 무엇입니까?

Bash 명령 매뉴얼에 -e 옵션이 없는 이유는 무엇입니까?

bash 매뉴얼에 -e 옵션이 없어서 약간 혼란스럽습니다.man bash

하지만 다음과 같은 스크립트 shebang을 사용하고 있습니다. #!/bin/bash -e물론 help set.

bash 매뉴얼의 옵션에 왜 나열되지 않습니까?

답변1

이 내용은 설명서 시작 부분에 암시적으로 언급되어 있습니다.

옵션 내장 명령 설명 ( 포함 )
에 문서화된 모든 단일 문자 셸 옵션은 셸을 호출할 때 옵션으로 사용할 수 있습니다. [...]set-o

set그런 다음 내장 명령에 대한 매뉴얼을 자세히 살펴보거나 help set대화형 쉘 세션에서 이를 사용하거나(질문에서 언급한 대로) 적절한 방법(예: info bash set시스템을 통해)으로 더 긴 참조 매뉴얼에 액세스 해야 합니다. 명령을 사용하여).

답변2

bash(1) 매뉴얼 페이지에 있습니다 set. 데비안 기반 시스템을 포함한 일부 시스템에서는 정보를 더 쉽게 찾을 수 있는 해당 쉘의 내장 기능만 다루는 bash-buildins(7) 또는 심지어 내장(7) 매뉴얼 페이지도 찾을 수 있습니다.

...

  -e      Exit immediately if a pipeline (which may consist  of  a
          single  simple  command),  a list, or a compound command
          (see SHELL GRAMMAR above), exits with a non-zero status.
          The  shell  does  not  exit if the command that fails is
          part of the command list immediately following  a  while
          or  until  keyword, part of the test following the if or
          elif reserved words, part of any command executed  in  a
          &&  or || list except the command following the final &&
          or ||, any command in a pipeline but the last, or if the
          command's  return  value is being inverted with !.  If a
          compound command other than a subshell  returns  a  non-
          zero  status because a command failed while -e was being
          ignored, the shell does not exit.  A  trap  on  ERR,  if
          set,  is  executed  before the shell exits.  This option
          applies to the shell environment and each subshell envi‐
          ronment  separately  (see  COMMAND EXECUTION ENVIRONMENT
          above), and may cause subshells to exit before executing
          all the commands in the subshell.

          If  a  compound  command or shell function executes in a
          context where -e is being ignored, none of the  commands
          executed  within  the  compound command or function body
          will be affected by the -e setting, even if  -e  is  set
          and  a  command returns a failure status.  If a compound
          command or shell function sets -e while executing  in  a
          context  where -e is ignored, that setting will not have
          any effect until the compound  command  or  the  command
          containing the function call completes.

...

  errexit Same as -e.

...

관련 정보