Bash set utility?
set
set -e
set -e 가 script 내에 실행되어있으면 동작하는 쉘 환경은 script명령어가 error 를 발생하면서 죽었을때 다음 명령을 수행하지 않는다
exit code
일반적으로 unix 에서는 0 은 성공, 1255 는 error code 로 인식됨
인식되는 범위는 0255 16bit
$? 로 결과값을 확인 가능
$ cat test.sh
echo "hello"
exit 100
$ sh test.sh
hello
$ echo $?
100
set -x
set -x 가 script 내에 실행되어있으면 동작하는 쉘 환경은 모든 쉘 커맨드를 verbose 모드로 보여준다.
Appendix. References
Share this article
Found this helpful? Share it with your network
관련 글
Working with Bash Arrays
Bash: How to Check if Directory Exists
Bash eval - Dynamic Command Execution
Join the Discussion
Share your thoughts and connect with other readers
댓글
GitHub 계정으로 로그인하여 댓글을 남겨보세요. 건설적인 의견과 질문을 환영합니다!
댓글을 불러오는 중...
댓글을 불러올 수 없습니다.