可以在bash中使用正则表达式:

string="a b '' c '' d"
if [[ "$string" =~ \ |\' ]]    #  slightly more readable: if [[ "$string" =~ ( |\') ]]
then
   echo "Matches"
else
   echo "No matches"
fi

相关文章:

  • 2022-12-23
  • 2021-10-12
  • 2021-11-04
  • 2022-02-02
  • 2022-01-08
  • 2022-12-23
  • 2021-05-31
  • 2021-10-03
猜你喜欢
  • 2021-09-01
  • 2021-09-13
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-01-28
  • 2022-12-23
相关资源
相似解决方案