[gentoo-user] Bug in bash ?

2007-04-21 Thread alain . didierjean
Can somebody explain why
ls [A-Z]*
works as ls * (or ls -R):
It seems that [A-Z] is ignored by bash-3.1.17 on amd64.
The expression works as expected with zsh...

-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Bug in bash ?

2007-04-21 Thread Jan Seeger
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

This is no bug. Bash globs everything that begins with A-Z (also
directories) and then gives that list to ls. So ls lists all these files
and the directories that begin with A-Z. Strangely though, bash seems to
ignore case. (When I try your command, ls gives me all the files that
begin with a letter and excludes files that begin with a number) 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGKc7ZMmLQdC6jvocRAjoiAJ9guN8zoA5A2ZxQIZxEeyGxdb9TggCdFbgb
c0NkXZqd15DLXNNsd1liS5Y=
=m/kr
-END PGP SIGNATURE-
-- 
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] Bug in bash ?

2007-04-21 Thread Renat Golubchyk
On Sat, 21 Apr 2007 10:44:09 +0200 Jan Seeger [EMAIL PROTECTED]
wrote:
 This is no bug. Bash globs everything that begins with A-Z (also
 directories) and then gives that list to ls. So ls lists all these
 files and the directories that begin with A-Z. Strangely though, bash
 seems to ignore case. (When I try your command, ls gives me all the
 files that begin with a letter and excludes files that begin with a
 number)

That happens because of your locale setting. If LC_COLLATE is not C
or POSIX then e.g. [A-D] can be equal to [AbBcCdD] or [AaBbCcD]. So
set LC_COLLATE to C and you'll get a portable behaviour.

Cheers,
Renat

-- 
Probleme kann man niemals mit derselben Denkweise loesen,
durch die sie entstanden sind.
  (Einstein)


signature.asc
Description: PGP signature


Re: [gentoo-user] Bug in bash ?

2007-04-21 Thread Bo Ørsted Andresen
On Saturday 21 April 2007 09:52:40 [EMAIL PROTECTED] wrote:
 Can somebody explain why
 ls [A-Z]*
 works as ls * (or ls -R):
 It seems that [A-Z] is ignored by bash-3.1.17 on amd64.
 The expression works as expected with zsh...

Try `ls [[:upper:]]*`. Also -R is recursive. You should google that since you 
don't seem to know what it means..

-- 
Bo Andresen


signature.asc
Description: This is a digitally signed message part.