On 8/7/20 4:14 AM, Antonio Diaz Diaz wrote: > I propose to revert this change to remain consistent with POSIX. It's not a POSIX issue, since POSIX doesn't specify -L, which means grep can do whatever it wants if you specify -L. > But in GNU grep 3.2 to 3.4 -q inverts the exit status when -L is also used. Now 'grep -L > /dev/null' and 'grep -Lq' return opposite values. That is indeed a bug. I looked into this a bit further, and it turns out that when the Git folks were told that git-grep behaved differently from GNU grep 3.1 and earlier, they changed git-grep to match. This was around the same time we changed GNU grep to behave more like the git-grep at the time. What a comedy of errors, huh? Anyway, given all these issues it does seem like it's wise to revert the change. I installed the attached patch into GNU grep master, with the goal of something like this appearing in the next grep release. Thanks for reporting the problem.