刚创建的.sh
文件,可能因为权限问题不能执行,可以使用chmod
命令给shell
文件授权:
chmod +x test.sh
然后进到shell脚本所在的文件夹,以下三条指令均可以执行.sh
文件:
sh test.sh
bash test.sh
./test.sh
刚创建的.sh
文件,可能因为权限问题不能执行,可以使用chmod
命令给shell
文件授权:
chmod +x test.sh
然后进到shell脚本所在的文件夹,以下三条指令均可以执行.sh
文件:
sh test.sh
bash test.sh
./test.sh