Sergey Poznyakoff wrote:
Neil R. Ormos <[EMAIL PROTECTED]> wrote:
Nonetheless, I would observe that the elm version of readmsg is quite useful for copying verbatim one or more messages from one mbox-format mailbox into another mbox-format mailbox, using the -h option. It would be useful to have similar functionality in the GNU Mailutils readmsg, regardless of which option flag must be requested to access this functionality, because eventually, maintenance of elm will likely cease.
I see. I will apply the 1st patch to CVS head, then.
On my test system (Debian Sarge), after the patch you offered on 12 Feb 2007, the invocation
readmsg -w 'From_ \' -f source.mbox 5 6 7 >destination.mbox
From the shell's point of view, 'From_ \' is an error (the closing quote is missing), that's why I thought it was a typo and tried 'From_ '\' instead.
Indeed, when using this form literally, I obtain the same results as you. It is due to the fact that mailutils word splitter (argcv module) parses this string in two words: 'From_' and ''. The first one instructs readmsg to output From markers, the second one matches any headers (One can argue that it should not have removed the trailing \, but that's another story). You would get the same effect with any of the following (correct from the shells point of view) calls:
readmsg -w 'From_ ""' readmsg -w "From_ ''"
Thank you for pointing this out. This duplicates the functionality of the elm readmsg -h option. I should have discovered these on my own, but didn't realize that the -w option would handle "" or '' pairs specially. (For what it's worth, elm readmsg treats these quote pairs as header patterns beginning with the quotes, rather than as an empty string.) Perhaps the man page for readmsg could include a hint to users about how to duplicate the behavior of the -h option of elm readmsg to extract messages verbatim from mbox format mailboxes. I'd be happy to contribute some proposed language, but I might need some help to produce a patch in the proper format.
I have not seen documentation for readmsg that specifies that the arguments to -w are treated as "patterns",
Well, this is a terminological issue, which can be argued, indeed. In my understanding, they can be called "patterns" because they do not match the header names exactly, instead any header whose prefix matches is selected.
Thanks. I see what you mean now. I was erroneously interpreting "patterns" too narrowly as meaning the kind of regular-expression pattern matching present in AWK, etc.
so I wasn't aware that ! is intended to be special.
According to readmsg(1):
"A list entry may be preceded by an exclamation point to suppress the header."
Thus, ! is special. But this is the only mention of its special meaning in the docs. It does not specify how the matcher should behave when encountering "X !X" or "!X X".
I was looking at the info page and the (Debian)
man page for readmsg.
Yes, the above excerpt was taken from this manpage as well.
I wasn't clear enough in my prior message. I don't know which features of elm readmsg are intended to carry over into GNU Mailutils readmsg. I did see the "preceded by an exclamation point" instruction in the readmsg(1) man page supplied by elm 2.5.8., but not in any of the GNU Mailutils documentation. I looked at the info page furnished with Mailutils 1.1 and the web man page at: <http://www.gnu.org/software/mailutils/manual/html_node/readmsg.html> If I should be looking elsewhere at something more up-to-date, please let me know. Thank you for your help and patience. Best regards, --Neil Ormos _______________________________________________ Bug-mailutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-mailutils
