特牛网址导航

linux 包含关系,Bash技巧:使用[[命令的 =~ 操作符判断字符串的包含关系-CSDN博客

网友收藏
文章浏览阅读379次。在 Linux bash shell 中,可以使用 [[ 命令来进行判断。其中,可以使用 [[ 命令的 =~ 操作符来判断某个字符串是否包含特定模式。查看 man bash 对 [[ 命令的 =~ 操作符说明如下:An additional binary operator, =~, is available, with the same precedence as == and !=.When i..._=~ binary oprator