用Shell判断字符串包含关系
摘要:
方法一:利用grep查找 strA="long string" strB="string" result=$(echo $strA | grep "${strB}") if [[ "$result" != "" ]] then echo "包含" else echo "不包含" fi 先打印长字符串 阅读全文
posted @ 2021-02-08 14:18 uestc2007 阅读(87) 评论(0) 推荐(0) 编辑