首先是存放目录,建议选择/usr/local/sbin方便管理 创建脚本文件 vi hello.sh 第一步:标准格式 #!/bin/bash 第二步:注释(解释程序的功能和用途) 第三步:开始写功能 echo “helloworld” 第四步:赋予权限 chmod u+x hello.sh 第五步:执行 ./hello.sh