09 2017 档案

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的菜鸟 阅读(2159) 评论(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的菜鸟 阅读(11922) 评论(0) 推荐(0)

shell脚本中的dat,计算器,内置变量的用法
摘要:什么是shell脚本。首先它是一个脚本,并不能作为正式的编程语言。因为是跑在linux的shell中,所以叫shell脚本。说白了,shell脚本就是一些命令的集合。举个例子,我想实现这样的操作: 1)进入到/tmp/目录; 2)列出当前目录中所有的文件名; 3)把所有当前的文件拷贝到/root/目 阅读全文

posted @ 2017-09-02 19:46 学习linux的菜鸟 阅读(1459) 评论(0) 推荐(0)

导航