p=0
for i in {1..10000};do k=`cat file.${i}|grep '!'`; \
if [[ -n $k ]];then p=$((p+1)); fi; done
echo $p
查看file1~file10000中有多少含有“!”感叹号的
linux逻辑判断:https://blog.csdn.net/weixin_30826761/article/details/94855475
p=0
for i in {1..10000};do k=`cat file.${i}|grep '!'`; \
if [[ -n $k ]];then p=$((p+1)); fi; done
echo $p
查看file1~file10000中有多少含有“!”感叹号的
linux逻辑判断:https://blog.csdn.net/weixin_30826761/article/details/94855475
本文标题:Linux shell 字符串非空判断
本文链接:https://www.haomeiwen.com/subject/jghooktx.html
网友评论