Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jun 2021 16:08:23 +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-69kQCVviX7@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-256473-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256473

--- Comment #4 from Stefan Eßer <se@FreeBSD.org> ---
(In reply to Jason W. Bacon from comment #2)

> I created a simple test case to reduce noise in this thread, and things got weirder:
> 
> Default shell is tcsh.
> 
> 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 comes after
"Z").

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

This is to be expected. The sequence is as above and you are selecting for all
except those starting with "A" (which is "to the left" of "a").

> FreeBSD coral.acadix  bacon ~/Test 1035: bash
> [bacon@coral ~/Test]$ ls -d [A-Z]*
> Alan Bob
> 
> [bacon@coral ~/Test]$ ls -d [a-z]*
> aardvark zip
> [/quote]

This is the behavior of BASH if the "globasciiranges" shell option is set to
on.

Check this with the following command:

$ shopt globasciiranges
globasciiranges on

This is an off by default option according to the bash man-page, but apparently
set in your environment.

With this variable set to off, bash behaves exactly like the other shells.

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

help

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