【发布时间】:2012-05-28 12:44:16
【问题描述】:
鉴于以下情况:
$ echo $BASH_VERSION
4.2.10(1)-release
$ shopt | fgrep case
nocaseglob off
nocasematch off
$ case A in [a-z]) echo TRUE;; esac
TRUE
我希望大写字母 A不 与 [a-z] 的小写字符类匹配,但它确实如此。为什么这个匹配没有失败?
【问题讨论】:
-
nocaseglob不相关:If set, bash matches filenames in a case-insensitive fashion when performing pathname expansion (see Pathname Expansion above),尽管行为仍然很奇怪。
标签: bash pattern-matching