2009-04-8, 08:35(-04), Chet Ramey: >> Configuration Information [Automatically generated, do not change]: >> Machine: hppa2.0 >> OS: hpux10.20 >> Compiler: /net/appl/gcc-3.3/bin/gcc >> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='hppa2.0' >> -DCONF_OSTYPE='hpux10.20' -DCONF_MACHTYPE='hppa2.0-hp-hpux10.20' >> -DCONF_VENDOR='hp' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' >> -DSHELL -DHAVE_CONFIG_H -DHPUX -I. -I. -I./include -I./lib -I./lib/intl >> -I/var/tmp/bash-4.0/lib/intl -g -O2 >> uname output: HP-UX imadev B.10.20 A 9000/785 2008897791 two-user license >> Machine Type: hppa2.0-hp-hpux10.20 >> >> Bash Version: 4.0 >> Patch Level: 10 >> Release Status: release >> >> Description: >> Strings compared with [[ string1 < string2 ]] are supposed to use >> the current locale, but they don't. > > It's a documentation error (but a long-standing one). The code has > always used strcmp, not strcoll. [...]
For information, pdksh, zsh, dash ([), gawk behave like bash (that's a POSIX conformance bug for gawk). ksh93, GNU expr behave as the OP expected. Every POSIX utility that compare strings (sort, comm, join, RE ranges...) is meant to be locale dependant, so I support ifever [[ is ever added to POSIX, that will have to be the case as well for consistency. -- Stéphane