Can some body pl tell me why this if condition doesn't output Matched and how to change the reg exp pattern with expr to display the output as Matched. The thing is that instead of BH in the var variable there can be any country code like US or CA. All the other characters in the variable remains the same.
var1="BH.EBS.EBS.BH.RCMS.RCMS.FBACCR"
if [ `expr $var1 : "*.EBS.EBS.*.RCMS.RCMS.FBACCR"` -gt 0 ]; then
echo "Matched"
else
echo "Not matched"
fi
Thanks Gautam