有没有一种简单的方法可以注释掉 shell 脚本中的代码块?
In bash:
#!/bin/bash
echo before comment
: <<'END'
bla bla
blurfl
END
echo after comment
The '
and '
周围的END
分隔符很重要,否则块内的内容例如$(command)
将被解析并执行。
有关解释,请参阅this https://stackoverflow.com/questions/32126653/how-does-end-work-in-bash-to-create-a-multi-line-comment-block and this https://unix.stackexchange.com/questions/37411/multiline-shell-script-comments-how-does-this-work/问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)