如何创建和执行shell脚本
# ./1.shbash: ./1.sh: 权限不够
# ls -l 1.sh
-rw-r--r-- 1 root root 73 11-06 14:48 1.sh
下一步赋予自己执行该文件的权限,使用chmod命令
# chmod u+x 1.sh
# ls -l 1.sh
-rwxr--r-- 1 root root 73 11-06 14:48 1.sh
开始执行脚本
# ./1.sh
2014年 11月 06日 星期四 14:52:50 CST
root pts/1 2014-11-06 09:03 (192.168.18.22)
页:
[1]