[Bug 220654] New: wildcard/regular-expression in bash
https://bugzilla.novell.com/show_bug.cgi?id=220654 Summary: wildcard/regular-expression in bash Product: SUSE LINUX 10.0 Version: Final Platform: Other OS/Version: SuSE Linux 10.0 Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: mehrdad.ziaei@senecac.on.ca QAContact: qa@suse.de The following command should print list of all files that have A, B or C in their name, but instead it lists all the files. ( *[ABC]* works fine though ) echo *[A-C]* or ls *[A-C]* The problem happens when I use range in bracket. The value of LANG environment variable for the user is en_US.UTF-8 if I set LANG to POSIX then it works fine! -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=220654 ------- Comment #1 from chrubis@novell.com 2006-11-14 09:43 MST ------- *** Bug 220645 has been marked as a duplicate of this bug. *** -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=220654 ------- Comment #2 from chrubis@novell.com 2006-11-14 09:43 MST ------- *** Bug 220646 has been marked as a duplicate of this bug. *** -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=220654 ------- Comment #3 from chrubis@novell.com 2006-11-14 09:44 MST ------- *** Bug 220647 has been marked as a duplicate of this bug. *** -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=220654 chrubis@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|bnc-team- |werner@novell.com |screening@forge.provo.novell| |.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=220654 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WORKSFORME ------- Comment #4 from werner@novell.com 2006-11-16 03:06 MST ------- This has nothing to do with the bash. Please talk to ANSI how about sorting should happen in en_US. Btw: this is not a bug of the bug but a feature of the glibc and the locale description therein. You make choose an other locale for sorting by setting export LC_COLLATE POSIX within your personal ~/.bashrc -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=220654 ------- Comment #5 from mehrdad.ziaei@senecac.on.ca 2006-11-16 15:56 MST ------- I changed RC_LC_COLLATE in /etc/sysconfig/language to apply changes for all [non root] users and it worked as well. I will check ANSI for the sort, but even with en_US shouldn't I get at least the same result for ls *[ABC]* and ls *[A-C]* ? But I don't, that's why I thought there is a bug. Am I mistaken somewhere or there is something wrong? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=220654 ------- Comment #6 from mehrdad.ziaei@senecac.on.ca 2006-11-16 16:12 MST ------- btw, in tcsh and ksh both ls commands work the same. only in bash they work differently. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
https://bugzilla.novell.com/show_bug.cgi?id=220654 werner@novell.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pbaudis@novell.com ------- Comment #7 from werner@novell.com 2006-11-17 03:05 MST ------- The bash or better /bin/ls uses the sorting rules provided by the glibc simply by using the glibc interface setlocale(). The builtins of ksh and tcsh do not. Please talk to the glibc locale people because I've no idea what sorintg rules in the USA are valid. I'm familiar with german and POSIX sorting rules (which do also differ). See with a simnple test which locale will be loaded: /tmp/test> touch A a B b C c /tmp/test> ls A B C a b c /tmp/test> export LC_COLLATE=en_US.UTF-8 /tmp/test> strace -e open ls *[A-C]* open("/etc/ld.so.cache", O_RDONLY) = 3 open("/lib64/tls/librt.so.1", O_RDONLY) = 3 open("/lib64/libacl.so.1", O_RDONLY) = 3 open("/lib64/libselinux.so.1", O_RDONLY) = 3 open("/lib64/tls/libc.so.6", O_RDONLY) = 3 open("/lib64/tls/libpthread.so.0", O_RDONLY) = 3 open("/lib64/libattr.so.1", O_RDONLY) = 3 open("/proc/mounts", O_RDONLY) = 3 open("/usr/lib/locale/locale-archive", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/locale.alias", O_RDONLY) = 3 open("/usr/lib/locale/en_US.UTF-8/LC_COLLATE", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/lib/locale/en_US.utf8/LC_COLLATE", O_RDONLY) = 3 open("/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 3 open("/proc/filesystems", O_RDONLY) = 3 A b B c C I've no idea why the sorting rules within /usr/lib/locale/en_*/LC_COLLATE are not case sensitive and if this is valid within the laws of the USA, GB and all the others. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
participants (1)
-
bugzilla_noreply@novell.com