From owner-freebsd-questions@FreeBSD.ORG Thu Dec 17 00:12:08 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C68F7106568B for ; Thu, 17 Dec 2009 00:12:08 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 7E94F8FC12 for ; Thu, 17 Dec 2009 00:12:08 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.3/8.14.3) with ESMTP id nBH0C2V9098068; Wed, 16 Dec 2009 17:12:02 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.3/8.14.3/Submit) with ESMTP id nBH0C2TH098065; Wed, 16 Dec 2009 17:12:02 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Wed, 16 Dec 2009 17:12:02 -0700 (MST) From: Warren Block To: Martin McCormick In-Reply-To: <200912161636.nBGGaebB018830@dc.cis.okstate.edu> Message-ID: References: <200912161636.nBGGaebB018830@dc.cis.okstate.edu> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (wonkity.com [127.0.0.1]); Wed, 16 Dec 2009 17:12:02 -0700 (MST) Cc: freebsd-questions@freebsd.org Subject: Re: sed -f Script Syntax 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: Thu, 17 Dec 2009 00:12:08 -0000 On Wed, 16 Dec 2009, Martin McCormick wrote: > If you have a sed script that is executable as in the first line > starts with > #! /usr/bin/sed -f > and the following lines are like: > > /this repetitive line/d > /and another repetitive line to go/d > > This all works great. You just make the file executable and use > it as a filter if you want to remove any instance of those lines > in text. > > How does one embed a command in this filter to make sed > understand an extended or modern regular expression like: > > /part 1[[:space:]]text\/html[[:space:]]/d > > This is normally the -e flag but I haven't figured out how to put it > in the script. I would like to either use it to make that one line > show up as an extended regular expression or make sed run the entire > script in the -e mode. sed(1) says it should be -E. Looks like it will only work on the whole script. -Warren Block * Rapid City, South Dakota USA