[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #14630] feature request: grep -p[separator]

From: Charles Levert
Subject: [bug #14630] feature request: grep -p[separator]
Date: Sat, 24 Sep 2005 16:33:40 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050920 Firefox/1.0.7

Update of bug #14630 (project grep):

                Severity:              3 - Normal => 1 - Wish               


Follow-up Comment #1:

"Shocked" sounds somewhat quite strong a word.  It's not so surprising that a
non-standard extension which can readily be replicated with common existing
tools is not implemented in GNU grep.

/sbin/ifconfig -a | awk 'BEGIN {RS = "\n\n"} /127/'
/sbin/ifconfig -a | perl -ne 'BEGIN {$/ = "\n\n"} print if /127/'

Even with its four superfluous spaces characters, the awk solution is even
shorter than, say

/sbin/ifconfig -a | grep --input-record-separator='\n\n' 127

given that awk and perl also support an output record separator, which
someone would invariably ask to be supported as well with its own distinctive
option, sooner or later.

It's easy enough to define a shell function or minimal awk/perl script around
either of the two basic one-line templates above.

Do we really need to add this to GNU grep?


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]