리눅스 set -x

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 }}