Advanced Bash-Scripting Guide在示例中广泛使用了多行注释,格式如下:
echo ls -l | sh
# Passes the output of "echo ls -l" to the shell,
#+ with the same result as a simple "ls -l".(可在管道|符号的说明中找到)。其他多行注释如下所示:
#!/bin/bash
# rpm-check.sh
# Queries an rpm file for description, listing,
#+ and whether it can be installed.
# Saves output to a file.
#
# This script illustrates using a code block.(链接页面中的示例3.2 )。
使用#+的费用是多少?一些多行注释似乎表明注释在下一行继续,但另一些则不是。
在我自己的脚本中有没有一个我应该(尝试)遵循的“bash-scripting评论礼仪”?
发布于 2012-12-19 16:19:31
似乎高级Bash脚本指南的作者在前一行中的句子后面的行中使用了它。
这不是标准的风格选择;这似乎是高级Bash脚本指南的作者的风格怪癖。
我要指出的是,虽然高级Bash脚本指南中有一些很好的技术信息,但其编码风格是相当不标准的。我不会用它来举例说明什么是好的Bash编码实践。一个更好的资源是Bash FAQ。
https://stackoverflow.com/questions/13947877
复制相似问题