📌  相关文章
📜  bash 检查字符串是否以子字符串开头 - Shell-Bash 代码示例

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

代码示例1
# Original source: Advanced Bash Scripting Guide (http://tldp.org/LDP/abs/html/comparison-ops.html)
# The == comparison operator behaves differently within a double-brackets
# test than within single brackets.

[[ $a == z* ]]   # True if $a starts with a "z" (wildcard matching).
[[ $a == "z*" ]] # True if $a is equal to z* (literal matching).