例一影响(#)线之前和/或注释,如#!/ bin/sh的行之后
#!/bin/sh
# purpose: print out current directory name and contents
pwd
ls
例二
# purpose: print out current directory name and contents
#!/bin/sh
pwd
ls
是什么差异 - 如果我在第一行发表评论(#
),#!/bin/sh
作为第二行,会发生什么情况?
#!/bin/sh
是什么意思?
如果您使用代码标签包围脚本,将会更容易。不规则字体使它真的让人困惑...... – user1581900 2013-05-13 07:32:10
#!/ bin/sh指定应该用于脚本的shell的路径。在这里回答了类似的问题:http:// stackoverflow。com/questions/8967902/why-do-you-need-to-put-bin-bash-at-the-a-start-of-a-script-file – user1581900 2013-05-13 07:34:24
可能会出现重复的情况。/7366775/what-do-line-bin-sh-mean-in-a-unix-shell-script – Peeyush 2013-05-13 07:34:27