-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Bruce Korb on 3/26/2007 2:49 PM: > The default locale is the C locale. Nevertheless, one shell (not ksh > or Solaris' sh) > thinks it is okay for [a-z] to match 'B' even when all locale > variables are undefined. > In other words, this: > > unset LANG `env|sed -n 's/=.*//;/^LC_/p'` > ls [a-z]* > > is insufficient.
According to POSIX, all programs start life in the C locale. But bash, and many other programs that use libintl, immediately invoke setlocale (LC_ALL, ""), as recommended by the gettext documentation. It is this action which changes the current locale to the system default, if you do not have any environment variables defined to tell the system which locale YOU want. If you don't like your system defaults, then blame the distros that have chosen a non-C locale as the default when setlocale is invoked with an empty string, rather than blaming bash. If you are writing portable shell scripts, get in the habit of setting LC_ALL=C near the beginning. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGCJgR84KuGfSFAYARAlnqAKCNDnyNsoHxrINoTHdh6sy/mGku7QCfQgl0 ywXIOWQXl/jRZXFnrY3PhJw= =rRQG -----END PGP SIGNATURE-----
