#!/bin/bash
printf "*************************************\n"
a=0
while read line
do
[[ $line =~ "css" ]] && ((a++))
done < test.txt
echo $a
Shell 脚本 遍历文件 找出包含特定字符串的行数
最新推荐文章于 2023-06-06 11:02:43 发布
#!/bin/bash
printf "*************************************\n"
a=0
while read line
do
[[ $line =~ "css" ]] && ((a++))
done < test.txt
echo $a