From owner-freebsd-questions@FreeBSD.ORG Wed Mar 14 14:33:49 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 5A9F316A403 for ; Wed, 14 Mar 2007 14:33:49 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout4.cac.washington.edu (mxout4.cac.washington.edu [140.142.33.19]) by mx1.freebsd.org (Postfix) with ESMTP id 34FCA13C43E for ; Wed, 14 Mar 2007 14:33:49 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.141] (may be forged)) by mxout4.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2EEXmAZ011998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 14 Mar 2007 07:33:48 -0700 X-Auth-Received: from [192.168.10.42] (c-67-187-172-183.hsd1.ca.comcast.net [67.187.172.183]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW07.03) with ESMTP id l2EEXm4q023106 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Wed, 14 Mar 2007 07:33:48 -0700 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: References: X-Gpgmail-State: !signed Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Garrett Cooper Date: Wed, 14 Mar 2007 07:33:47 -0700 To: FreeBSD Questions X-Mailer: Apple Mail (2.752.2) X-PMX-Version: 5.3.0.289146, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.3.14.72434 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__C230066_P5 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0' 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 14:33:49 -0000 On Mar 14, 2007, at 2:56 AM, 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. > > Thanks so much.. > > Bruce Stitt > TSYS Hosting Services > Voice 706-644-0965 As mentioned, when doing simple regex replacements in Unix, some good languages / programs to use are: grep <- extraction only sed <- simple extraction / replacement perl <- the kitchen sink -Garrett