"리눅스 set -x"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
 
34번째 줄: 34번째 줄:


==같이 보기==
==같이 보기==
{{z컬럼3|
* [[리눅스 set]]
* [[리눅스 set]]
* [[리눅스 set -a]]
* [[리눅스 set -a]]
40번째 줄: 41번째 줄:
* [[리눅스 set -euxo pipefail]]
* [[리눅스 set -euxo pipefail]]
* [[리눅스 bash/sh 디버깅 sh -x]]
* [[리눅스 bash/sh 디버깅 sh -x]]
}}


[[분류: 리눅스 set]]
[[분류: 리눅스 set]]

2022년 11월 7일 (월) 23:51 기준 최신판

1 개요[ | ]

set -x
  • 디버그 용도로 자주 사용하는 옵션
  • 실행되는 명령어와 인수들을 출력한다.
Print commands and their arguments as they are executed.

2 실습[ | ]

root@zetawiki:~# cat a.sh
echo hello
echo world
root@zetawiki:~# sh a.sh
hello
world
→ 일반적인 수행 (명령어가 노출되지 않음)
root@zetawiki:~# cat b.sh
set -x
echo hello
echo world
root@zetawiki:~# sh b.sh
+ echo hello
hello
+ echo world
world
→ 수행하는 명령어를 보여준 후 실행함

3 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}