Package: grep;
To reply to this bug, email your comments to 35043 AT debbugs.gnu.org.
the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-grep <at> gnu.org:bug#35043; Package grep.
(2019年3月29日 20:48:02 GMT) Full text and rfc822 format available.Peng Yu <pengyu.ut <at> gmail.com>:bug-grep <at> gnu.org.
(2019年3月29日 20:48:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Peng Yu <pengyu.ut <at> gmail.com> To: bug-grep <at> gnu.org Subject: Is there a way to show file name once just before all the matches in the file? Date: 2019年3月29日 15:47:41 -0500
Hi, By default, filenames are shown at the same lines of the matches (when there are multiple files). But I'd like a filename only shown once before all the matches in the given file. Is there an option to do so with grep? Thanks. -- Regards, Peng
bug-grep <at> gnu.org:bug#35043; Package grep.
(2019年3月30日 03:03:01 GMT) Full text and rfc822 format available.Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
From: "Paul Jackson" <pj <at> usa.net> To: bug-grep <at> gnu.org Subject: Re: bug#35043: Is there a way to show file name once just before all the matches in the file? Date: 2019年3月29日 23:01:48 -0400
[Message part 1 (text/plain, inline)]
The following awk command will do this (so long as filenames don't have ':' colon chars):
grep IP /etc/protocols /etc/services |
awk -F: '
1ドル != fname { print 1ドル ":"; fname = 1ドル; }
{ sub("^[^:]*:", ""); print; }
'
--
Paul Jackson
pj <at> usa.net
[Message part 2 (text/html, inline)]
Paul Eggert <eggert <at> cs.ucla.edu>
to control <at> debbugs.gnu.org.
(2020年1月02日 09:28:01 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.