Date: Wed, 6 Jan 2016 00:15:59 +0100 From: Jilles Tjoelker <jilles@stack.nl> To: NGie Cooper <yaneurabeya@gmail.com> Cc: FreeBSD CURRENT <freebsd-current@freebsd.org>, Baptiste Daroussin <bapt@FreeBSD.org>, Dimitry Andric <dim@FreeBSD.org> Subject: Re: Can't run `make universe` on universe11a.freebsd.org and ref11-amd64.freebsd.org (anymore); [shell] globbing is broken [there] Message-ID: <20160105231558.GB17031@stack.nl> In-Reply-To: <30640BF0-84F3-446D-808E-547B04E9EA53@gmail.com> References: <091C7193-4EDD-4AE4-AC52-FD62B6934440@gmail.com> <30640BF0-84F3-446D-808E-547B04E9EA53@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jan 04, 2016 at 12:08:43PM -0800, NGie Cooper wrote: > > It looks like a libc problem though, because I’ve run into this > > issue with both /bin/sh and bash (my default login shell). I’m not > > sure why this isn’t reproing on my VM (yet). > > This doesn’t repro in universe10a.freebsd.org (another jail on the > > same machine I think…). > > It was working yesterday on ref11-amd64.freebsd.org before the > > system was upgraded (it was running October sources), and wasn’t > > working on universe11a.freebsd.org yesterday (it was running > > December sources yesterday). > delphij@ pointed me in the right direction (thanks :)..). Globbing > expressions seems extremely broken with LANG set to en_US.UTF-8 [at > least]. > $ echo $LANG > en_US.UTF-8 > $ hostname > universe11a.freebsd.org > $ (unset LANG; cd sys/amd64/conf && echo [A-Z0-9]*[A-Z0-9]) > DEFAULTS GENERIC GENERIC-NODEBUG MINIMAL NOTES Traditionally, ranges in bracket expressions like A-Z meant characters that collate between A and Z, inclusive. Although this used to be in POSIX and is widely implemented, it does not make much sense. POSIX.1-2008 leaves ranges undefined in locales other than the POSIX locale. Therefore, it is an option to disable collation for ranges and just compare character codes. The problem started to occur more often with the new collation code, which supports UTF-8 and uses CLDR's different collation order, but strange results from [A-Z] can be encountered in much older versions. Bash behaves similarly to sh, but supports 'shopt -s globasciiranges' to disable collation. In some sense this is strange, an option that needs to be enabled to provide the behaviour most people expect. Alternatively, the pattern could be rewritten to be locale-sensitive: [[:upper:][:digit:]]*[[:upper:][:digit:]] -- Jilles Tjoelker
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160105231558.GB17031>