Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您如何将字符串的后缀与 case 语句匹配?
例子
case "foobar" in "*bar") echo "yay!" ;; esac
如果您只是丢失引号,效果很好;
#!/bin/bash case "foobar" in *bar) echo "yay!" ;; esac