1.概念
shell是一个应用程序,用户通过shell输入命令可以访问操作系统内核的服务。shell脚本( shell script)是为shell编写的命令集合。linux系统中默认的shell是bash,windows中 powershell。
2.执行
1)将脚本作为可执行程序执行
./test.sh 执行当前目录下的test.sh脚本
2)使用bash或sh程序,将脚本作为命令参数
bash hello.sh sh hello.sh
shell是一个应用程序,用户通过shell输入命令可以访问操作系统内核的服务。shell脚本( shell script)是为shell编写的命令集合。linux系统中默认的shell是bash,windows中 powershell。
./test.sh 执行当前目录下的test.sh脚本
bash hello.sh sh hello.sh