随笔分类 - shell
摘要:参考:shell if -n 参数-CSDN博客 if [ -n str ] 当str非空的时候,为true,例: #!/bin/bash if [ -n $1 ];then echo "with args : $1" else echo "without args" fi 上面的几行脚本,不管我们
阅读全文
摘要:参考:https://cloud.tencent.com/developer/article/1869422 方法一: while read line; do [[ "$line" == "" ]] || echo "$line"; done < ./a >b 方法二: for line in `c
阅读全文