Problem with Bash

Kim Holburn kim.holburn at
Thu Dec 13 10:06:59 EST 2001


export LC_ALL=C

(What does this do exactly anyway?)

At 9:59 AM +1100 13/12/01, Christopher Delfs wrote:
>On Wed, 12 Dec 2001 23:40, Bob Edwards wrote:
>> Chris Delfs wrote:
>> > I feel stupid asking this but I can't see why bash (RH 7.2) is ignoring
>> > case in regular expressions.  For example
>> >
>> > ~/tmp 38>touch A B C D a b c d
>> > ~/tmp 39>ls
>> > a  A  b  B  c  C  d  D
>> > ~/tmp 40>ls [a-z]*
>> > a  A  b  B  c  C  d  D
>> Change the value of your LANG environment variable from "en_US" to "C".
>> Cheers,
>> Bob Edwards.
>wallach:~ 1>cd tmp
>wallach:~/tmp 2>ls [a-b]
>a  A  b
>wallach:~/tmp 3>export LANG=C
>wallach:~/tmp 4>ls [a-b]
>A  a  b
>wallach:~/tmp 5>ls
>A  B  C  a  b  c
>wallach:~/tmp 6>rm *
>/bin/rm: remove `a'? y
>/bin/rm: remove `A'? y
>/bin/rm: remove `b'? y
>/bin/rm: remove `B'? y
>/bin/rm: remove `c'? y
>/bin/rm: remove `C'? y
>wallach:~/tmp 7>touch A B C a b c
>wallach:~/tmp 8>ls
>A  B  C  a  b  c
>wallach:~/tmp 9>ls [a-b]*
>A  a  b
>wallach:~/tmp 10>
>Good try I was thinking along these lines.  This problem only seems to arise
>in the KDE Konsole.  It seems to me that since I get the 'A' and not the 'B'
>I have somehow managed to use some strange character set where
>the order of characters is aAbBcC... Is that possible?
>On any of the virtual consoles I get the correct behaviour.  Further more
>wallach:~ 1>telnet localhost
>Connected to localhost.
>Escape character is '^]'.
>Red Hat Linux release 7.2 (Enigma)
>Kernel 2.4.9-13 on an i686
>login: delfs
>Last login: Thu Dec 13 09:42:33 from wallach
>wallach:~ 1>cd tmp
>wallach:~/tmp 2>ls
>a  A  b  B  c  C
>wallach:~/tmp 3>ls [a-b]*
>a  b
>wallach:~/tmp 4>

Kim Holburn  Network Consultant  P/F: +61 2 61258620 M: +61 0417820641
Email: kim.holburn at - PGP Public Key on request

Life is complex - It has real and imaginary parts.
     Andrea Leistra (rec.arts.sf.written.Robert-jordan)

More information about the linux mailing list