2017年9月3日

shell脚本中的循环

摘要: 常用到的循环有for循环和while循环。 [root@localhost sbin]# cat for.sh #! /bin/bash for i in `seq 1 5`; do echo $i done [root@localhost sbin]# cat for.sh #! /bin/bas 阅读全文

posted @ 2017-09-03 19:33 学习linux的菜鸟 阅读(2104) 评论(0) 推荐(0) 编辑

shell脚本中的逻辑判断

摘要: shell脚本中的逻辑判断 if 逻辑判断。在shell中if判断的基本语法为: 1)不带else if 判断语句; then command fi if 判断语句; then command fi 例如: [root@localhost sbin]# cat if1.sh #! /bin/bash 阅读全文

posted @ 2017-09-03 09:31 学习linux的菜鸟 阅读(11802) 评论(0) 推荐(0) 编辑

导航