Have you ever found interesting videos on YouTube, and…
March 5, 2018
Shell: debug所有运行过程到log文件, Run a bash script in debug mode, show output and save it on a file
直接代码:
bash -x test.sh 2>&1 | tee out.test
或者:
bash -x script.sh 2> log
-x表示debug模式
![Shell: debug所有运行过程到log文件, Run a bash script in debug mode, show output and save it on a file Shell: debug所有运行过程到log文件, Run a bash script in debug mode, show output and save it on a file](http://justcode.ikeepstudying.com/wp-content/uploads/2018/03/slide_13.jpg)
![Shell: debug所有运行过程到log文件, Run a bash script in debug mode, show output and save it on a file Shell: debug所有运行过程到log文件, Run a bash script in debug mode, show output and save it on a file](http://justcode.ikeepstudying.com/wp-content/uploads/2018/03/lico-14-debug-script-3-638.jpg)
![Shell: debug所有运行过程到log文件, Run a bash script in debug mode, show output and save it on a file Shell: debug所有运行过程到log文件, Run a bash script in debug mode, show output and save it on a file](http://justcode.ikeepstudying.com/wp-content/uploads/2018/03/slide_4.jpg)
本文:Shell: debug所有运行过程到log文件, Run a bash script in debug mode, show output and save it on a file