사용자 도구

사이트 도구


linux:bash

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
linux:bash [2020/08/27 22:06]
kwon37xi
linux:bash [2020/09/05 14:34]
kwon37xi [set -e/+e]
줄 198: 줄 198:
 </code> </code>
  
-===== set -e/+e ===== + 
-  * +===== Safe Shell Script ===== 
 +  * [[https://sipb.mit.edu/doc/safe-shell/|Writing Safe Shell Scripts]] 
 +  * [[https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/|Safer bash scripts with 'set -euxo pipefail' · vaneyckt.io]] 
 + 
 +<code sh> 
 +set -euf -o pipefail 
 +</code> 
 + 
 +==== set -e/+e ==== 
 +  * ''set -e'' : 오류 발생시 즉시 종료. 이것보다는 ''trap'' 사용을 권장함. [[http://mywiki.wooledge.org/BashFAQ/105|BashFAQ/105 -Why doesn't set -e (or set -o errexit, or trap ERR) do what I expected?]] 
 +  * ''set +e'' : 기본값. 오류 발생해도 무시하고 스크립트 진행. 
 ===== 참조 ===== ===== 참조 =====
   * http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html   * http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
linux/bash.txt · 마지막으로 수정됨: 2024/02/07 08:41 저자 kwon37xi