sh脚本文件的运行

sh脚本文件的运行
mac终端下运行shell脚本

1、写好自己的 脚本,比如test-bash.sh

2、打开终端 执行,方法一: 输入命令 ./test-bash.sh ,

方法二:直接把 aa.sh 拖入到终端里面。

问题:
wanghuideMBP:~ wanghui$ ./test-bash.sh
-bash: ./test-bash.sh: Permission denied
wanghuideMBP:~ wanghui$ chmod 777 test-bash.sh
wanghuideMBP:~ wanghui$ ./test-bash.sh

解决办法:

Permission denied就是没有权限。

修改该文件aa.sh 的权限 ,使用命令:

chmod 777 aa.sh 。

然后再执行 上面第二步的操作 就 OK .

猜你喜欢

转载自www.cnblogs.com/wanghui-garcia/p/9507650.html