19.1 shell 基本语法
19.1.3 什么是SHELL脚本?
[root@xuegod63 ~]# chmod +x test.sh
[root@xuegod63 ~]# ./test.sh #执行
shell脚本的执行通常有以下几种方式
1、/root/test.sh 或者 ./test.sh (当前路径下执行脚本的话要有执行权限chmod +x test.sh)
2、bash test.sh 或 sh test.sh (这种方式可以不对脚本文件添加执行权限)
3、source test.sh (可以没有执行权限)
4、sh < test.sh 或者 cat test.sh |sh(bash)