From owner-freebsd-questions Fri Sep 4 08:36:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA06704 for freebsd-questions-outgoing; Fri, 4 Sep 1998 08:36:58 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA06698 for ; Fri, 4 Sep 1998 08:36:55 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from ben by scientia.demon.co.uk with local (Exim 2.02 #26) id 0zExr1-000062-00; Fri, 4 Sep 1998 16:32:51 +0100 Date: Fri, 4 Sep 1998 16:32:51 +0100 From: Ben Smithurst To: Roman Katsnelson , "q's" Subject: Re: grep question Message-ID: <19980904163251.A29959@scientia.demon.co.uk> Reply-To: freebsd-questions@FreeBSD.ORG Mail-Followup-To: Roman Katsnelson , q's References: <35EFEEA4.65B3315F@graphnet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <35EFEEA4.65B3315F@graphnet.com> User-Agent: Mutt/0.94.3i (FreeBSD 3.0-CURRENT i386) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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