shell中使用注释,是使用#作为开头,本行其后的内容都会忽略,当做注释对待;
ls /
而在shell开头位置,我们经常可以见到:
#!/bin/sh
这句话的意思其实就是告诉系统,用什么类型的解释器来执行该脚本。linux/unix环境中有不同类型的shell,例如Bourne shell, K-shell, Bash 等等…类似于C语言中的#include引用库,该行通常出现脚本首部。这种首行叫做Shebang.
参考:
What is the real use of #! In shell scripting?ShebangShebang-wikipedia