Re: mutt+sed - deleting line ranges

"Sven Guckes [email protected] [sed-users]" <[email protected]>
Newsgroups gmane.editors.sed.user
Message-ID <[email protected]>
* Dan Goldman <[email protected]> [2016-01-19 23:44]:
> Sven, Here's a way (I think) to include the filter in a shell
> wrapper (filter.sh file). In this case, I think using a wrapper
> is better than solely relying upon sed, because it gives you a
> lot more flexibility to use other tools (tr, grep, awk, ex, etc).

thanks, Dan!

so.. a tempfile to work on with all tools within
a shell script - neat! i need to test this a bit..

>  $ cat ex.txt
> /^Posted by:/-1,//+1d
> wq
>
> cat ex.txt | ex -s $TMP_FILE # Modify content with ex

i like using the arithmentic of ex (vi;vim), of course.

but how to tackle this "RE1...RE2...RE3" thing?
selecting a range like "/RE1/,/RE3/" is easy -
but how to ensure that "RE2" in between that?
anyone here with some knowledge on awk?

Sven
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.