非常相似但不重复:https ://stackoverflow.com/a/2172367/57883
我在 Git Bash 3.1 中(至少当我在 git bash.
并且$ test [["DEV-0" == D*]] || echo 'fail'
打印失败。
if [['DEV-0-1' == DEV* ]]; then echo "yes";
说[[DEV-0-1: command not found
我正在尝试测试是否git branch
返回以 DEV 开头的内容。但我似乎无法应用答案。是因为我所有的尝试都在左侧使用字符串文字而不是变量值吗?
我也试过 ideone http://ideone.com/3IyEND
没有运气。自从我擅长使用 linux 提示符以来已经有 14 年了。
我在 bash 中以 test 开头的字符串缺少什么?