Linux中sh执行脚本命令没有权限也能正常执行
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash
免费下载资源
·
sh+脚本名称,可以不必事先设定shell的执行权限。因为这个是将test.sh作为参数传给sh(bash)命令来执行的。这时不是test.sh自己来执行,而是被人家调用执行,所以不要执行权限。
[root@iz2ze720onwdpm0gqiky35z 51mn]# ls -lrt test.sh
-r--r--r-- 1 root root 22 Oct 14 22:34 test.sh
[root@iz2ze720onwdpm0gqiky35z 51mn]# sh test.sh
hello world
如果直接运行test.sh,就会报权限问题
[root@iz2ze720onwdpm0gqiky35z 51mn]# ./test.sh
-bash: ./test.sh: Permission denied
GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:23 天前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
已为社区贡献7条内容
所有评论(0)