Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Dec 2009 17:12:02 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        Martin McCormick <martin@dc.cis.okstate.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: sed -f Script Syntax
Message-ID:  <alpine.BSF.2.00.0912161707400.97785@wonkity.com>
In-Reply-To: <200912161636.nBGGaebB018830@dc.cis.okstate.edu>
References:  <200912161636.nBGGaebB018830@dc.cis.okstate.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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



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