Re: gnu grep -o flag

2010-03-25 Thread Denis Doroshenko
On Wed, Mar 24, 2010 at 11:13 PM, Philip Guenther guent...@gmail.com wrote: On Wed, Mar 24, 2010 at 1:06 PM, Philip Guenther guent...@gmail.com wrote: ... Hmm, missing quote, and the expressions can be combined, but as a portable solution this is indeed the right answer. B B sed -n -e

Re: gnu grep -o flag

2010-03-25 Thread Chris Dukes
On Wed, Mar 24, 2010 at 09:10:48PM -0500, Ed Ahlsen-Girard wrote: I'm sure there is a case in which sed should be used instead of perl, but I haven't run across it yet. I've encountered two cases over the past 20 years. 1) Perl is not installed and probably will never be installed. That

Re: gnu grep -o flag

2010-03-24 Thread Jan Stary
On Mar 24 19:00:06, Gregory Edigarov wrote: Hello Everybody, Just wonder how could one implement what gnu grep -o flag does using our toolchain? from ggrep(1): -o, --only-matching Show only the part of a matching line that matches PATTERN. Hint: what

Re: gnu grep -o flag

2010-03-24 Thread Christopher Zimmermann
On Wed, 24 Mar 2010 19:00:06 +0200 Gregory Edigarov wrote: Hello Everybody, Just wonder how could one implement what gnu grep -o flag does using our toolchain? from ggrep(1): -o, --only-matching Show only the part of a matching line that matches

Re: gnu grep -o flag

2010-03-24 Thread Marco Peereboom
huh? didn't you just grep for that? On Wed, Mar 24, 2010 at 07:00:06PM +0200, Gregory Edigarov wrote: Hello Everybody, Just wonder how could one implement what gnu grep -o flag does using our toolchain? from ggrep(1): -o, --only-matching Show only the part of a

Re: gnu grep -o flag

2010-03-24 Thread Brad Tilley
No. i...@iso2:~/Desktop$ grep import IDS_targets.py import MySQLdb import socket import getpass import datetime i...@iso2:~/Desktop$ grep import -o IDS_targets.py import import import import On Wed, 24 Mar 2010 13:33 -0500, Marco Peereboom sl...@peereboom.us wrote: huh? didn't you just

Re: gnu grep -o flag

2010-03-24 Thread Ted Unangst
On Wed, Mar 24, 2010 at 1:00 PM, Gregory Edigarov g...@bestnet.kharkov.ua wrote: Just wonder how could one implement what gnu grep -o flag does using our toolchain? With a 10 line patch.

Re: gnu grep -o flag

2010-03-24 Thread Philip Guenther
On Wed, Mar 24, 2010 at 10:17 AM, Christopher Zimmermann madro...@zakweb.de wrote: On Wed, 24 Mar 2010 19:00:06 +0200 Gregory Edigarov wrote: Just wonder how could one implement what gnu grep -o flag does using our toolchain? from ggrep(1): -o, --only-matching Show only the

Re: gnu grep -o flag

2010-03-24 Thread Christopher Zimmermann
On Wed, 24 Mar 2010 13:06:12 -0700 Philip Guenther wrote: On Wed, Mar 24, 2010 at 10:17 AM, Christopher Zimmermann madro...@zakweb.de wrote: On Wed, 24 Mar 2010 19:00:06 +0200 Gregory Edigarov wrote: Just wonder how could one implement what gnu grep -o flag does using our toolchain?

Re: gnu grep -o flag

2010-03-24 Thread Philip Guenther
On Wed, Mar 24, 2010 at 1:06 PM, Philip Guenther guent...@gmail.com wrote: ... Hmm, missing quote, and the expressions can be combined, but as a portable solution this is indeed the right answer. sed -n -e 's/.*\(PATTERN\).*/\1/p' Actually, there are two bug in that, an obvious one and a

Re: gnu grep -o flag

2010-03-24 Thread Marco Peereboom
Congratulations you found import! On Wed, Mar 24, 2010 at 02:52:31PM -0400, Brad Tilley wrote: No. i...@iso2:~/Desktop$ grep import IDS_targets.py import MySQLdb import socket import getpass import datetime i...@iso2:~/Desktop$ grep import -o IDS_targets.py import import import

Re: gnu grep -o flag

2010-03-24 Thread Ed Ahlsen-Girard
On Wed, Mar 24, 2010 at 2010-03-24 21:13:40, Philip Guenther guent...@gmail.com wrote: ... Hmm, missing quote, and the expressions can be combined, but as a portable solution this is indeed the right answer. sed -n -e 's/.*\(PATTERN\).*/\1/p' Actually, there are two bug in that, an