上届世界杯_世界杯韩国 - cngkpt.com

执行.sh文件(shell脚本)的几种方式

第一种:(要进到shell脚本所在文件夹中)

sh helloworld.sh

第二种:(要进到shell脚本所在文件夹中)

bash helloworld.sh

第三种:(要进到shell脚本所在文件夹中)

./helloworld.sh

第四种:

/home/data/helloworld.sh

注意:如果刚创建.sh文件,使用./ 或者绝对路径执行不了时,很可能是因为权限不够。此时你可以使用chmod命令来给shell文件授权。之后就能正常运行了。

chmod +x helloworld.sh