shell 执行
demo.sh
#! /bin/bash
echo "This is a demo"
shell 执行
$ chmod 0777 demo.sh
$ ./demo.sh
This is a demo
shell 注释
- 单行注释
以 # 开头的行就是注释,会被解释器忽略。
示例:
#! /bin/bash #echo "This is a comment" echo "This is a demo"
如上所示 demo.sh 执行后还是只会有一行输出
- 多行注释