摘要: 1.if语句的日常操作 #!/bin/bash if [ $? -eq 0 ]; then echo "执行成功" else echo "mkl" fi #判断文件夹是不是存在 test_dir=/root/bin/ if [ ! -d "$test_dir" ]; then echo "是文件夹" 阅读全文
posted @ 2020-04-08 15:38 马小纪 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 1.常识 输入到字符串或者一定内容到另一个文件(会把目标的文件清空) echo "hello world!" > a.txt cat a.txt > b.txt 输入到字符串或者一定内容到另一个文件(不会把目标文件清空,会继续追加,) echo "hello world!" >> a.txt cat 阅读全文
posted @ 2020-04-08 09:51 马小纪 阅读(276) 评论(0) 推荐(0) 编辑