GNU bug report logs - #42245
grep -l -c does not work like expected

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: grep; Severity: wishlist; Reported by: muellae@HIDDEN; dated Tue, 7 Jul 2020 14:46:02 UTC; Maintainer for grep is bug-grep@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Paul Eggert <eggert@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 7 Jul 2020 14:45:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 07 10:45:20 2020
Received: from localhost ([127.0.0.1]:36466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jsoqV-0007NV-Li
	for submit <at> debbugs.gnu.org; Tue, 07 Jul 2020 10:45:19 -0400
Received: from lists.gnu.org ([209.51.188.17]:45302)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <muell_collect@HIDDEN>) id 1jsn1v-0004GT-Gy
 for submit <at> debbugs.gnu.org; Tue, 07 Jul 2020 08:49:00 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:36866)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <muell_collect@HIDDEN>)
 id 1jsn1v-0004et-8p
 for bug-grep@HIDDEN; Tue, 07 Jul 2020 08:48:59 -0400
Received: from mout.kundenserver.de ([217.72.192.75]:40027)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <muell_collect@HIDDEN>)
 id 1jsn1t-0003uR-4Q
 for bug-grep@HIDDEN; Tue, 07 Jul 2020 08:48:58 -0400
Received: from [192.168.150.32] ([87.123.137.76]) by mrelayeu.kundenserver.de
 (mreue108 [212.227.15.183]) with ESMTPSA (Nemesis) id
 1MfHMj-1kZYUv0MTz-00gl7s for <bug-grep@HIDDEN>; Tue, 07 Jul 2020 14:48:54
 +0200
To: bug-grep@HIDDEN
From: Volker Raab <muell_collect@HIDDEN>
Subject: grep -l -c does not work like expected
X-Pep-Version: 2.0
Message-ID: <369c6f34-53b2-4301-83bf-12af24d1c823@HIDDEN>
Date: Tue, 7 Jul 2020 14:48:53 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.8.0
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------52ED27E7E801726F7F42D919"
Content-Language: en-US
X-Provags-ID: V03:K1:EsFn/LwNB8In4sYluX1EcROSwf7KqxRtLjC4Vv4arA0osBLY2CN
 VJWTQAFxYUx7zyebb/gqdca+LgnV9FoY6Cg4zQ7Q+/PbxDzkcn4SjckBRNyAiDTnWQ1fTZG
 wMYINcDQpwIWZA7v7QvkS5+xkowuLvtUcI2HX/lT5nAmByXupB8h/lHZJjrM7L9OIsQVSJ8
 l2SkLnQ2HDMKjesbXtMHA==
X-Spam-Flag: NO
X-UI-Out-Filterresults: notjunk:1;V03:K0:m3yXGzTvvUs=:EKN8CBh2JJGV2ExGGJRc56
 ULq2baIEd9vf3AlA7QRvKGpUZ58217/I8SztEdmX86klgJJpqm/CYS0MNMVE8Kjme30Tbv6Re
 c0dPTr93eIAtqmBbK4Itf673exfmP0DVUpD6d/7eQqWGYR2aEL9kfbediOeZpEnw2kFoz+bOU
 iXeuCDMBNhCPpO5p0rG+agfLUwqlLH2IKVg5sMLsIgfP8UDtcpbsk8QEXStPnxm9QUb0wpEGZ
 idoTm+1Nd+LH3UebixpGyNh74rXuTmTXkeyNA9ZYckRhJ+prWaCUuN5UE9D86aabyZr1X7lQ/
 EJCukmEfgmXTk6b//h5xpZXnPLtSjLSSJaxEsMONl6mxPJ84FBkH2FnEMpbmPwhmumyj307gy
 J2ksXQ0hM9nNCblwxaUWgvGk86Sh9vjX1uLCvebdXbk9C1YZCBLVOrHQD3pi2YMEI8G7upV1D
 1xnRylAPE5L0zn9l70b1u8F0rHArZF1zvDFnsWkWTemy2h1rvmT0+LLa0g+L6/mL1okX9CW87
 d9TAA56QuLMIrHuM6L8SRk5JB2LsaO3w7q5tOUFgUin0eOSqkuO/1oleDHYAf8RN1oJa4jvmi
 qf5YzoqWkgQD7zdexXIojdFPaIGbdhlAQ7of6Y/OEun1C82vQG54XDFY/jH9jT2BX3elGnATT
 v0R9oklqCzLSkCbSWp1vNIpDIzo7OF6dwD6zuTnUaoAi10/9sK1Rph5Q9xfMsLntrMvNHYFYp
 vOxemsdeACYzERVmo6P88gHsm6Gvv8u1MOZbGfgi1JluB9XcjfUdDjSQ/iVsapM1dIXf5tjtj
 FLHjxq4CUhCtjC2hsoFycGBh4kmQklOtLyhGnYH5gs5+sSe2oj42WfeX69P11TCHwgmKadE
Received-SPF: none client-ip=217.72.192.75;
 envelope-from=muell_collect@HIDDEN; helo=mout.kundenserver.de
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/07 08:48:54
X-ACL-Warn: Detected OS   = Linux 2.2.x-3.x [generic]
X-Spam_score_int: -28
X-Spam_score: -2.9
X-Spam_bar: --
X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001,
 RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Tue, 07 Jul 2020 10:45:18 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: muellae@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

This is a multi-part message in MIME format.
--------------52ED27E7E801726F7F42D919
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi all,


are the options "-l" and "-c" mutually incompatible?
And if so, why?

What happens:
When I enter 'grep -c search *' I get _all_ files listed with the number
of matches (many of them with appended ":0" ).
When I enter 'grep -c search *' I get a list of files which match.

But:
When I enter 'grep -l -c search *' I still get the same result as
without '-c'. (the same happens if I exchange '-l' and '-c')

What I expect:
In the latter case I would expect to get a list of all files that match
with an appended ":xxx'  where the xxx denotes the number of matches,
none of which is ":0"

Comment:
Yes, of course I can pipe the result through 'grep -v :0' but this is
clumsy and does not mend that the combination of '-l' and '-c' does not
produce the expected result.

Thanks a lot for considering this in future versions.


Best regards
		Volker




--------------52ED27E7E801726F7F42D919
Content-Type: application/pgp-keys;
 name="pEpkey.asc"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="pEpkey.asc"

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQGNBF4ycYcBDAC7Oi8dTyxFthZkI1ATsGMZj0/wOy3umhXzIDLGIkfNgprpoqN9
EuZqECbBIDtVmxNQvL6HlwTY3WoG6PJkRbRYqYqCOYLBQOe92ILbzIJkxgk52Pt+
BBgx/ImUL1tc2NvbKaHQLih2CkcdH9k69TggckZz8XuKgojJomOw3Z1POPxvBW8d
4fpoRllGwrAwPwVeo7/kC+IOLO9yevtQgp5X9rV+ku2y/bJABaGgT7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gL9waeMw=3D=3D
=3DuUn7
-----END PGP PUBLIC KEY BLOCK-----

--------------52ED27E7E801726F7F42D919--




Acknowledgement sent to muellae@HIDDEN:
New bug report received and forwarded. Copy sent to bug-grep@HIDDEN. Full text available.
Report forwarded to bug-grep@HIDDEN:
bug#42245; Package grep. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 21 Sep 2020 20:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.