linux权限一:./和 sh 的区别

举例

登陆用户root查看权限
-rwx—— 1 root root

现在执行这个shell脚本
./test 成功

sh test 成功

现在去掉执行权限x

-rw——- 1 root root 17 2011-09-22 23:33 test

还是执行这个shell脚本

./test 失败 (-bash: ./test: Permission denied)

sh test 成功

区别

sh表示脚本默认使用sh脚本解释器
未指定脚本解释器默认为 ./

猜你喜欢

转载自blog.csdn.net/qq_34300892/article/details/81505730