Date: Wed, 16 Dec 2009 10:36:40 -0600 From: Martin McCormick <martin@dc.cis.okstate.edu> To: freebsd-questions@freebsd.org Subject: sed -f Script Syntax Message-ID: <200912161636.nBGGaebB018830@dc.cis.okstate.edu>
next in thread | raw e-mail | index | archive | help
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. In this particular case, I have made a 14-line script called nuisancefilter that vaporizes annoying blocks of text from Email messages. I have read the man page and it says that this is possible, but I never quite understood how to apply the commands to an executable sed script file. Many thanks. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912161636.nBGGaebB018830>