阅读背景:

shell-1 创建shell脚本

来源:互联网 
[oh@localhost shell]$ ./s1.sh
bash: ./s1.sh: Permission denied
[oh@localhost shell]$ echo $PATH
/usr/lib/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oh/bin
[oh@localhost shell]$ 
[oh@localhost shell]$ ls -l 
total 4
-rw-rw-r--. 1 oh oh 74 Mar 25 14:12 s1.sh
[oh@localhost shell]$ chmod u+x s1.sh 
[oh@localhost shell]$ ./s1.sh 
Sun Mar 25 14:15:52 CST 2018
oh       tty1         2018-03-25 21:41 (:0)
oh       pts/0        2018-03-25 21:43 (:0.0)
oh       pts/1        2018-03-25 13:59 (:0.0)
[oh@localhost shell]$ cat s1.sh 
#!/bin/bash
#this script displays the date and who's logged on

date
who

[oh@localhost shell]$ 
[oh@localhost shell]$ ./s1.sh
bash: ./s1.sh: Pe



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: