1.创建shell脚本

vi hello.sh

2.编写

shell学习 入门教程1

3.执行

1.作为可执行程序执行

chmod +x ./hello.sh          #使脚本具有执行权限

./hello.sh         #执行脚本

2.作为解释器参数执行

/bin/sh hello.sh

输出结果:

shell学习 入门教程1


相关文章: