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

            Bug ID: 253209
           Summary: grep -v -f some-empty-file does the wrong thing
           Product: Base System
           Version: 13.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]

# >a
# echo blubb | fgrep -f a
# echo blubb | fgrep -v -f a
#

Actually -v should invert the match however if the file is empty it seems it's
not doing the right thing.

For comparison (some random RedHat):

# uname -a
Linux rh.local 3.10.0-862.3.2.el7.x86_64 #1 SMP Tue May 15 18:22:15 EDT 2018
x86_64 x86_64 x86_64 GNU/Linux
# >a
# echo blubb | fgrep -f a
# echo blubb | fgrep -v -f a
blubb
# 

I stumbled over this while debugging a non-working script. I seem to remember
that it was working fine a while ago on stable/12.2.

I suspect related to base r352691 - maybe the removal of the invert logic near
the end of util.c.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to