sh文件执行报错

执行时提示权限不够,处理方法:使用chmod命令为该文件增加x权限

[root@CentOS sh]# ./helloworld.sh
-bash: ./helloworld.sh: 权限不够

执行时提示:没有那个文件或目录

[root@CentOS sh]# ./helloworld.sh
-bash: ./helloworld.sh: bin/sh: bad interpreter: 没有那个文件或目录

解决方法:sh文件内容开头必须是如下内容,注意bin前必须有“/”

#!/bin/sh

猜你喜欢

转载自blog.csdn.net/jewely/article/details/76976015