2、shell 判断字符串是否包含另一个字符串

*通配符匹配

!/bin/bash

version=$(cat /etc/redhat-release |awk '{print $4}')
echo $version

if [[ $version == 8 ]]; then
echo "包含"
else
echo "不包含"
fi

`

原文地址:https://www.cnblogs.com/whxiao/p/13355970.html