Article View: news.software.readers
Article #8129Re: Trn elm suggestion. mbox.saver hack.
From: David W. Tamkin
Date: Fri, 18 Mar 1994 23:17
Date: Fri, 18 Mar 1994 23:17
31 lines
2024 bytes
2024 bytes
robert@steffi.demon.co.uk (Robert Nicholson) wrote in
<2mda5g$v2@steffi.demon.co.uk>:
| I changed this line to
|
| /usr/ucb/tail +$5c $1 | /bin/sed "s/^From />From /" | /usr/local/bin/formail -a "Status: RO"
Do you really want to lose the "From " from the first line? formail can
re-create a From_ header but it will preserve the original one if given one.
/bin/sed '/^$/,$ s/^From />&/' | /usr/local/bin/formail -I "Status: RO"
[I should think you'd want to force RO Status even if a Status: header
already exists, hence -I instead of -a.]
| If you have a sed rule to do this I'd like to hear it, just for the sake of
| it. I'm ok with substitutions but the man page doesn't realy help
| when you want to add text to an input stream in a specific location.
Getting the job done right with sed is complicated; I've been burned too many
times by posting answers to sed questions and then getting flamed by people
who copy them wrong and blame me for posting lies.
sed can do it, but it seems to me that the only reason you're calling sed
is to defuse body lines beginning with "From ". formail should do that if
you don't use its -b flag to suppress the behavior. Ergo
/usr/local/bin/formail -I "Status: RO"
ought to be enough.
Technical Details
Message-ID:
<2mdcq0$kd7@genesis.MCS.COM>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.mail.elm.mbox.zip!gmd.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!news.kei.com!ddsw1!not-for-mailReferences:
<2mda5g$v2@steffi.demon.co.uk>Show Full Headers
Complete Article Headers
Message-ID: <2mdcq0$kd7@genesis.MCS.COM> Subject: Re: Trn elm suggestion. mbox.saver hack. Date: Fri, 18 Mar 1994 23:17:20 +0000 From: dattier@MCS.COM (David W. Tamkin) References: <2mda5g$v2@steffi.demon.co.uk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.mail.elm.mbox.zip!gmd.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!europa.eng.gtefsd.com!MathWorks.Com!news.kei.com!ddsw1!not-for-mail Newsgroups: comp.mail.elm,news.software.readers Organization: Elink Account on MCSNet, Chicago, Illinois 60657 Lines: 30 NNTP-Posting-Host: genesis.mcs.com