Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jun 2021 16:57:34 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 256473] FreeBSD shells are case insensitive for character ranges
Message-ID:  <bug-256473-227-juaJehXt4p@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-256473-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-256473-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256473

--- Comment #6 from Jason W. Bacon <jwb@freebsd.org> ---
(In reply to Stefan E=C3=9Fer from comment #4)

>> FreeBSD coral.acadix  bacon ~/Test 1032: ls
>> aardvark  Alan      Bob       zip
>> FreeBSD coral.acadix  bacon ~/Test 1033: ls -d [A-Z]*
>Alan  Bob   zip

>This is to be expected. The sequence is: "AaBb..Zz" and you are selecting =
for >all initial letters except for the files starting with "z" (which come=
s after >"Z").

I see the pattern now, but your range expansion above is incorrect and does=
n't
agree with the ls output I provided.

The lower case letters actually come first, which is not what I expected
either.  That's why the output seemed inexplicable at first.

[A-Z] =3D=3D [AbB..zZ] =3D=3D all letters except 'a'
[a-z] =3D=3D [aAbB..z] =3D=3D all letters except 'Z'

[A-Z]* selects for all but those that start with 'a', not 'z'.  This explai=
ns
why zip is listed and aardvark is not.

Adding one more file to clarify:

FreeBSD coral.acadix  bacon ~/Test 1013: ls
aardvark  Alan      Bob       Zed       zip

FreeBSD coral.acadix  bacon ~/Test 1014: ls -d [A-Z]*
Alan  Bob   Zed   zip

FreeBSD coral.acadix  bacon ~/Test 1015: ls -d [a-z]*
aardvark  Alan      Bob       zip

FreeBSD coral.acadix  bacon ~/Test 1020: ls -d [A-z]*
Alan  Bob   zip

FreeBSD coral.acadix  bacon ~/Test 1021: ls -d [a-Z]*
aardvark  Alan      Bob       Zed       zip

globasciirnages appears to be on by default in the bash port (not from anyt=
hing
in my env), but disabling with with shopt -u does make bash behave like tcs=
h.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-256473-227-juaJehXt4p>