摘要:
学习linux的菜鸟 shell脚本中的循环 常用到的循环有for循环和while循环。 for循环 [root@localhost sbin]# cat for.sh #! /bin/bash for i in `seq 1 5`; do echo $i done 脚本中的 seq 1 5 表示从 阅读全文
摘要:
shell脚本中的逻辑判断 if 逻辑判断。在shell中if判断的基本语法为: 1)不带else if 判断语句; then command fi 例如: [root@localhost sbin]# cat if1.sh #! /bin/bash read -p "Please input yo 阅读全文
摘要:
什么是shell脚本。首先它是一个脚本,并不能作为正式的编程语言。因为是跑在linux的shell中,所以叫shell脚本。说白了,shell脚本就是一些命令的集合。举个例子,我想实现这样的操作: 1)进入到/tmp/目录; 2)列出当前目录中所有的文件名; 3)把所有当前的文件拷贝到/root/目 阅读全文