strA=`grep "555" 1.txt`----------->首先查到包含555的行
strB="444"
if [[ $strA =~ $strB ]]------------->判断查到的内容是否包含444
then
echo "yes"
else
echo "no"
fi
判断grep到的内容是否包含特定的字符
最新推荐文章于 2024-05-11 22:29:21 发布
strA=`grep "555" 1.txt`----------->首先查到包含555的行
strB="444"
if [[ $strA =~ $strB ]]------------->判断查到的内容是否包含444
then
echo "yes"
else
echo "no"
fi