摘要: 1、linux系统中case主要用于选择执行、在需要进行多重分支的情况下使用,case在多个范围内匹配数据,若匹配成则执行相关的命令并结束整个条件测试。 简单示例: [root@linuxprobe test]# ls test.sh [root@linuxprobe test]# cat test 阅读全文
posted @ 2020-10-14 21:00 小鲨鱼2018 阅读(1939) 评论(0) 推荐(0) 编辑
摘要: 1、 直接创建用户 [root@linuxprobe home]# pwd/home [root@linuxprobe home]# ls a.txt linuxprobe software test.sh [root@linuxprobe home]# seq -f liujiaxin%02g 1 阅读全文
posted @ 2020-10-14 14:53 小鲨鱼2018 阅读(833) 评论(0) 推荐(0) 编辑
摘要: 1、&& 表示与,上一句执行成功则执行下一句;|| 表示或,上一句执行失败则执行下一句 [root@linuxprobe test]# touch a.txt [root@linuxprobe test]# ls a.txt [root@linuxprobe test]# [ -e a.txt ] 阅读全文
posted @ 2020-10-14 12:13 小鲨鱼2018 阅读(179) 评论(0) 推荐(0) 编辑