Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Sep 1998 16:32:51 +0100
From:      Ben Smithurst <ben@scientia.demon.co.uk>
To:        Roman Katsnelson <romank@graphnet.com>, "q's" <freebsd-questions@FreeBSD.ORG>
Subject:   Re: grep question
Message-ID:  <19980904163251.A29959@scientia.demon.co.uk>
In-Reply-To: <35EFEEA4.65B3315F@graphnet.com>
References:  <35EFEEA4.65B3315F@graphnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Roman Katsnelson wrote:

> grep -e "uniquerecordname" -A 13 -B 2 #this yields the record correctly.

[...]

> i've tried outputting the grep result in the first example to a new
> file, and then doing a diff on the two -- that works, but it puts a > in
> the beginning of each line, which is unacceptable. 

grep -e "uniquerecordname" -A 13 -B 2 db.file | \
   diff - db.file | grep '^> ' | sed 's/^> //'

Tried that?

-- 
Ben Smithurst : ben@scientia.demon.co.uk : http://www.scientia.demon.co.uk/

PGP: 0x99392F7D - 3D 89 87 42 CE CA 93 4C  68 32 0E D5 36 05 3D 16
     http://www.scientia.demon.co.uk/ben/pgp-key.html (or use keyservers)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980904163251.A29959>