Hi, I'm currently working through some basic HOWTOS (Linux Fundamentals 1-4 by Gentoo founder Daniel Robbins) on a CentOS 5.5 server, just to keep in shape. I've just noticed a curious wildcard behaviour, which I can't really explain. Let's say I wanted to list all the files or directories in /tmp starting with any uppercase character. Normally, I would do this : $ ls -d /tmp/[A-Z]* Curiously enough, this command lists *all* the content of /tmp, consisting of a majority of files and directories starting with a *lowercase* character. I've tested this on two different machines, with the same results. I'm puzzled. Can anybody offer an explanation for this curious behaviour ? Cheers, Niki
Niki Kovacs wrote:> Hi, > > I'm currently working through some basic HOWTOS (Linux Fundamentals 1-4 > by Gentoo founder Daniel Robbins) on a CentOS 5.5 server, just to keep > in shape. > > I've just noticed a curious wildcard behaviour, which I can't really > explain. Let's say I wanted to list all the files or directories in /tmp > starting with any uppercase character. Normally, I would do this : > > $ ls -d /tmp/[A-Z]* > > Curiously enough, this command lists *all* the content of /tmp, > consisting of a majority of files and directories starting with a > *lowercase* character. I've tested this on two different machines, with > the same results. I'm puzzled. > > Can anybody offer an explanation for this curious behaviour ?probably "expected" behavior, depending on your locale. google for LC_COLLATE. LC_COLLATE='C' ; ls -d /tmp/[A-Z]* should do what you want.
> > $ ls -d /tmp/[A-Z]*Works as expected here.> Can anybody offer an explanation for this curious behaviour ?Try: alias ls (to see if you're getting invisible flags enabled) /bin/ls -d /tmp/[A-Z]* (to try the command without such) ******************************************************************* This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept for the presence of computer viruses. www.Hubbell.com - Hubbell Incorporated**