[linux-l] case-less bash

Oliver Bandel oliver at first.in-berlin.de
So Nov 18 01:22:34 CET 2007


Hallo,


ist es in der letzten Zeit Mode geworden,
Shells nur noch caseless arbeiten zu lassen?


===============================================
oliver at siouxsie2:~$ cd /tmp/
oliver at siouxsie2:/tmp$ mkdir VERSUCH
oliver at siouxsie2:/tmp$ cd VERSUCH/
oliver at siouxsie2:/tmp/VERSUCH$ touch a b c d e f A B C D E F
oliver at siouxsie2:/tmp/VERSUCH$ ls [a-z]
a  A  b  B  c  C  d  D  e  E  f  F
oliver at siouxsie2:/tmp/VERSUCH$ ls [A-Z]
A  b  B  c  C  d  D  e  E  f  F
oliver at siouxsie2:/tmp/VERSUCH$ /bin/ls [A-Z]
A  b  B  c  C  d  D  e  E  f  F
oliver at siouxsie2:/tmp/VERSUCH$ echo $SHELL
/bin/bash
oliver at siouxsie2:/tmp/VERSUCH$ ls | grep "[a-z]"
a
A
b
B
c
C
d
D
e
E
f
F

oliver at siouxsie2:/tmp/VERSUCH$ ls | grep "[A-Z]"
A
B
C
D
E
F
oliver at siouxsie2:/tmp/VERSUCH$ ls [A-Z]
A  b  B  c  C  d  D  e  E  f  F
===============================================

Dann habe ich mal in der Doku zur Bash geschaut,
also mal RTFM gemacht.

Da gab es zwar ein "nocasematch" als Shelloption, aber das bringt mich auch
nicht weiter, denn:

===============================================
oliver at siouxsie2:~$ shopt | grep case
nocaseglob      off
nocasematch     off
oliver at siouxsie2:~$
===============================================

Seltsam ist auch, daß sich das ls bei [a-z]
für case-insensitive entscheidet, bei ls [A-Z] aber für
case-sensitiv.

Irgend ne Ahnung, was der grund sein kann?

Muss ich mal wieder die Brille putzen, damit ich das
Probleme sehe oder steht ihr auch vorm Tor und macht "Muuuh"?!

TIA,
   Oliver


P.S.: Nein, ls ist kein built-in, das habe ich schon mit
  enable -a | grep ls
abgeprüft.



Mehr Informationen über die Mailingliste linux-l