Page MenuHomeFreeBSD

grep: fix combination of quite and count flag
ClosedPublic

Authored by oshogbo on Jul 8 2021, 11:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 7, 11:29 PM
Unknown Object (File)
Sat, Feb 7, 8:40 PM
Unknown Object (File)
Sat, Jan 31, 1:33 PM
Unknown Object (File)
Jan 5 2026, 11:37 AM
Unknown Object (File)
Nov 20 2025, 10:50 PM
Unknown Object (File)
Nov 2 2025, 3:59 AM
Unknown Object (File)
Oct 21 2025, 8:05 AM
Unknown Object (File)
Oct 16 2025, 1:51 AM
Subscribers
None

Details

Summary

When the quite (-q) flag is provided, we don't expect any output.
Currently, the behavior is broken:
$ grep -cq flag util.c
1

$ grep -cs flag util.c
55

First of all, we print a number to stdout. Secondly, it just returns 0 or 1
(which is unexpected). GNU grep with c and q flags doesn't print anything.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable