[root@localhost /]# vi /u01/app/chengcj/hello.sh
#!/bin/bash
#This is a very simple example
echo Hello World, Hello Chengcj
~
~
~
~
~
~
~
--按下wq
"/u01/app/chengcj/hello.sh" [New] 3L, 75C written
[root@localhost /]# /u01/app/chengcj/hello.sh
-bash: /u01/app/chengcj/hello.sh: Permission denied
[root@localhost /]# chmod +x hello.sh
chmod: cannot access `hello.sh': No such file or directory
[root@localhost /]# chmod +x /u01/app/chengcj/hello.sh
---这一步不可缺少哦!!!
[root@localhost /]# /u01/app/chengcj/hello.sh
Hello World, Hello Chengcj
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/24156512/viewspace-720294/
,如需转载,请注明出处,否则将追究法律责任。