shell编程格式

#!/bin/bash              //表头声明(shell编程的标识)

#filename:first_shell.sh       //文件名称

#auto echo hello world!         //脚本内容

#by authors wugk 2019         //写明时间,脚本功能,用户名

echo “Hello World”                //echo为输出语句,输出内容为Hello World

chmod o+x first_shell.sh      给first_shell.sh添加执行权限

./first_shell.sh                       运行first_shell.sh文件的命令

或者使用、bin/bash的环境就不需要执行权限,如下代码

/bin/bash first_shell.sh

不需要任何权限

猜你喜欢

转载自www.cnblogs.com/ztz-99a/p/11061642.html