On 8/4/15 11:33 PM, isabella parakiss wrote: > nocaseglob affects regex matching in [[ but according to the man page only > nocasematch should: > > nocaseglob > If set, bash matches filenames in a case-insensitive fashion when > performing pathname expansion (see Pathname Expansion above). > nocasematch > If set, bash matches patterns in a case-insensitive fashion when > performing matching while executing case or [[ conditional commands. > > > I don't know if it'd make sense to have case-insensitive glob matches and > case-sensitive regexes at the same time... It may not be that useful and > even counterintuitive. > Anyway, it's probably better to either remove glob_ignore_case from line > 67 in lib/sh/shmatch.c or document the actual behaviour, if intended.
It's intended. nocaseglob has always affected the behavior of regexp matching. The nocasematch variable was introduced over 10 years ago to decouple the previous behavior, which used nocaseglob and dates back to when that variable was introduced in bash-3.0. The request was to have a variable that allowed case-insensitive matching without tying it to case- insensitive globbing. The code still uses `nocaseglob' as well to retain backwards compatibility. Maybe it's finally time to change that. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/