From owner-freebsd-questions@FreeBSD.ORG Wed Mar 14 11:33:56 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8508216A401 for ; Wed, 14 Mar 2007 11:33:56 +0000 (UTC) (envelope-from cptsalek@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.233]) by mx1.freebsd.org (Postfix) with ESMTP id 442A813C45B for ; Wed, 14 Mar 2007 11:33:56 +0000 (UTC) (envelope-from cptsalek@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so127602wxc for ; Wed, 14 Mar 2007 04:33:55 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=MZMLXCcaIB4oOslPToRDB9ACKaNuzGeaAwaykQV6mn8lT7rkfXHAAhJLBvYm/d/Qg9vR3YhENCqXK6P8kO52Y106btOplG41JLk8TnIZbR1lE+7ZRAKZCmfQ0aQda4p+aYhjaPaz1+K4Mni+opzvSOqCuuGeDisA7lUzv56KfYg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=evcPzk9wvE8oEonY/Fo6pThZ3wyoUGuP1EHKKyfchVbbzDgtsCny4VRansXzA1tCgxvq3RfHfV95hDOD67MZ/op+kGcuRiWojq4KcoPDpe8z74eY2tC8oN0iR8RZlUDkIKLbWyaHr3ufR/iBD26+9zHHSRQUSbWaUn3Qw4dsjug= Received: by 10.70.115.17 with SMTP id n17mr3538309wxc.1173872035559; Wed, 14 Mar 2007 04:33:55 -0700 (PDT) Received: by 10.70.14.15 with HTTP; Wed, 14 Mar 2007 04:33:55 -0700 (PDT) Message-ID: <14989d6e0703140433t6fcdcccei9dc60b26bffc35bd@mail.gmail.com> Date: Wed, 14 Mar 2007 12:33:55 +0100 From: "Christian Walther" To: "bstitt@tsys.com" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: Cc: freebsd-questions@freebsd.org Subject: Re: Need a good Unix script that.. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Mar 2007 11:33:56 -0000 On 14/03/07, bstitt@tsys.com wrote: > Hello, > > I'm trying to write a script to delete all line that include a certain > pattern in an output file. I sending information to one of our Security > people and they take this data and create a spreadsheet on the > information, I have a constant reoccurring lines within the output file > that they do not need. I'm trying to use the sed command to remove lines > that fits a certain pattern but it does not appear to remove anything. > > Any helpful ideas or any useful links to scripts. > You can use something like: cat yourfile | grep -v pattern >newfile If there are several patterns to be removed, use something like: cat yourfile | egrep -v "(pattern1|pattern2|pattern3|...)" >newfile HTH Christian