![bash [-+]O shopt_name이 설명서에서 예상한 대로 작동하지 않습니다.](https://linux55.com/image/15246/bash%20%5B-%2B%5DO%20shopt_name%EC%9D%B4%20%EC%84%A4%EB%AA%85%EC%84%9C%EC%97%90%EC%84%9C%20%EC%98%88%EC%83%81%ED%95%9C%20%EB%8C%80%EB%A1%9C%20%EC%9E%91%EB%8F%99%ED%95%98%EC%A7%80%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
Bash 매뉴얼은 다음과 같이 말합니다:
"
[-+]O [shopt_option]
shopt_option is one of the shell options accepted by the
shopt builtin (see SHELL BUILTIN COMMANDS below). If
shopt_option is present, -O sets the value of that option;
+O unsets it. If shopt_option is not supplied, the names
and values of the shell options accepted by shopt are
printed on the standard output. If the invocation option
is +O, the output is displayed in a format that may be
reused as input.
"
그러나 현재 bash 인스턴스에 기본적으로 extglob 옵션이 설정되어 있다고 가정해 보겠습니다. 이제 bash를 실행하여 새 인스턴스를 호출하면 bash +O extglob
extglob이 새 인스턴스에 대해 계속 설정됩니다. 그러나 이제 shopt -u extglob
새 인스턴스에서 실행하면 extglob이 설정 해제됩니다.
무슨 일이죠? 왜 bash [-+]O opt_name
작동하지 않나요?
문제에 대한 나의 유일한 추측은 아마도 내가 달렸을 때 bash +O extglob
처음에는부트로더extglob의 bash를 닫은 다음 다시 bash하십시오.시작하다모든 구성 파일을 읽고 extglob처럼 기본적으로 켜져 있어야 하는 모든 shopt 옵션을 활성화합니다. 따라서 extglob이 처음에 비활성화되었더라도 다시 활성화하십시오.