develog

[bash] debugging script 본문

카테고리 없음

[bash] debugging script

냐옴 2023. 4. 18. 09:58

 

bash 실행하는 명령어를 콘솔에 출력하기

# 아래 명령 이후에 실행되는 스크립트는 콘솔에 출력된다
set -x

# 아래 명령 이후에 실행되는 스크립트는 콘솔에 출력되지 않는다
set +x

 

https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_03.html

 

Debugging Bash scripts

willy:~/scripts> bash -x script1.sh + clear + echo 'The script starts now.' The script starts now. + echo 'Hi, willy!' Hi, willy! + echo + echo 'I will now fetch you a list of connected users:' I will now fetch you a list of connected users: + echo + w 4:5

tldp.org

 

Comments