Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: Linux Questions
- To: tlug@example.com
- Subject: Re: Linux Questions
- From: turnbull@example.com (Stephen J. Turnbull)
- Date: Sat, 3 Aug 96 14:32 JST
- In-Reply-To: <Pine.HPP.3.91.960803005607.29469E-100000@example.com> (craig@example.com)
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
>>>>> "Craig" == C Oda <craig@example.com> writes: Craig> On Fri, 2 Aug 1996, Stephen J. Turnbull wrote: >> I will shortly have a procmail script that strips the TWICS ad, >> and I'll publish that when I've written it. :-) Nothing >> against TWICS, but I don't need to see Craig> Actually, this is a good thing to have. The digests get an Craig> annoying amount of these advertisements. I want to strip Craig> all of them out except for one at the end. Well, for you procmail users, here it is, and not too complicated: :0 f * ^TOtlug | sed -e '/^a word from the sponsor will appear below$/,$ d' If you want to get rid of material preceding the identifying line (such as the line of dashes in the TWICS ad) you could use a perl or maybe awk script instead (as far as I know it's hard to make sed understand the concept of embedded newlines in patterns). Or you could use a recipe like :0 f * ^TOtlug | sed -e '/^-------/,/Fax: 03-3353-6096$/ d' since the content is identical every time. However, this is very risky since many mailers use a line of dashes to separate attachments, as do some users. I suggest using the begin-line (^) and end-line ($) magic characters for two reasons. First, many people include the whole message or fail to remove the .sigs and then type *after* the included message. You'll lose all content in that case. Second, "a word from the sponsor" just might appear in a message, but it's unlikely to appear exactly on one line that way. I use the :0 c .backup :0 ic | cd .backup && rm -f dummy `ls -t msg.*|sed -e 1,50d` recipes to prevent complete lossage in that case anyway. -- Stephen John Turnbull University of Tsukuba Yaseppochi-Gumi Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp/ Tennodai 1-1-1, Tsukuba, 305 JAPAN turnbull@example.com ----------------------------------------------------------------- a word from the sponsor will appear below ----------------------------------------------------------------- The TLUG mailing list is proudly sponsored by TWICS - Japan's First Public-Access Internet System. Now offering 20,000 yen/year flat rate Internet access with no time charges. Full line of corporate Internet and intranet products are available. info@example.com Tel: 03-3351-5977 Fax: 03-3353-6096
- References:
- Re: Linux Questions
- From: "C. Oda" <craig@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: Linux Questions
- Next by Date: Discounted Computer Books
- Prev by thread: Re: Linux Questions
- Next by thread: Re: MO SCSI Drive problem
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links