📌  相关文章
📜  bash 字符串包含 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:48.510000             🧑  作者: Mango

代码示例3
#!/bin/bash

STR='GNU/Linux is an operating system'
SUB='Linux'

if [[ "$STR" =~ .*"$SUB".* ]]; then
  echo "It's there."
fi