[Bug 246000] grep range bracket expression bug

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Apr 28 15:36:20 UTC 2020


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

            Bug ID: 246000
           Summary: grep range bracket expression bug
           Product: Base System
           Version: 12.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs at FreeBSD.org
          Reporter: spy at spy.zp.ua

I was looking for files with uppercase letters in names using `ls | grep
"[A-Z]"` and got all lowercase files present in result. 
Then I tested grep, and seems I hit a bug, even more strange than I expected. 

Here is a simple way to reproduce:

# cat > 1111
a
b
c
d
A
B
C
D

# grep "[a-c]" 1111
a
b
c
A
B

# grep "[A-C]" 1111
b
c
A
B
C

# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=

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


More information about the freebsd-bugs mailing list