Table of Contents

Flag

不如先看看 manual page

想实现 Bash 脚本的 dry run?

-n      Read commands but do not execute them.  This may
                      be used to check a shell script for syntax errors.
                      This is ignored by interactive shells.
-v      Print shell input lines as they are read.
nemo@nemo-home-desktop:~$ echo 'python -c "import os"' > dry-run && bash -nv ./dry-run
python -c "import os"
Nemo Xiong avatar
Nemo Xiong
我永远喜欢妃爱
comments powered by Disqus