多行bash评论礼仪(#+;)
在示例中广泛使用多行注释,形式如下:多行bash评论礼仪(#+;),bash,Bash,在示例中广泛使用多行注释,形式如下: 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 whethe
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脚本注释礼仪” 高级Bash脚本指南的作者似乎在继续上一行句子的行中使用了该指南 这不是一个标准的文体选择;这似乎是《高级Bash脚本指南》作者的一个风格怪癖
我将注意到,虽然AdvancedBash脚本指南中有一些很好的技术信息,但编码风格是相当非标准的。我不会把它作为一个好的Bash编码实践的例子。一个更好的资源是。所有酷孩子都使用什么语法?我开玩笑说,我不喜欢这样,这会增加混乱和混乱。