Problem with Bash

Christopher Delfs christopher.delfs at anu.edu.au
Thu Dec 13 09:59:29 EST 2001


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
/home/delfs/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
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Red Hat Linux release 7.2 (Enigma)
Kernel 2.4.9-13 on an i686
login: delfs
Password:
Last login: Thu Dec 13 09:42:33 from wallach
wallach:~ 1>cd tmp
/home/delfs/tmp
wallach:~/tmp 2>ls
a  A  b  B  c  C
wallach:~/tmp 3>ls [a-b]*
a  b
wallach:~/tmp 4>




More information about the linux mailing list