linux shell判断字符串包含(类似于contains)

if echo "$string" | grep 'foo'; then
  echo "It's there!"
fi

猜你喜欢

转载自blog.csdn.net/a772304419/article/details/125525913