0%

【shell】判断字符串是否包含子串

https://blog.csdn.net/iamlihongwei/article/details/59484029

1
2
3
4
5
6
7
8
9
if [[ $line =~ "<BEGIN>" ]] 
then
echo "包含<BEGIN>"
elif [[ $line =~ "<SEG>" ]]
then
echo "包含<SEG>"
else
echo "都不包含"
fi