Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!mit-eddie!uw-beaver!blake!ogccse!schaefer From: schaefer@ogccse.ogc.edu (Barton E. Schaefer) Newsgroups: comp.mail.mush Subject: Re: Saving just mail headers Keywords: mail headers Message-ID: <4204@ogccse.ogc.edu> Date: 12 Aug 89 06:11:36 GMT References: <236@nikhefh.hep.nl> <120719@sun.Eng.Sun.COM> <4177@ogccse.ogc.edu> <6883@xenna.Xylogics.COM> Reply-To: schaefer@ogccse.UUCP (Barton E. Schaefer) Organization: Oregon Graduate Center, Beaverton, OR Lines: 35 In article <6883@xenna.Xylogics.COM> loverso@Xylogics.COM (John Robert LoVerso) writes: } In article <4177@ogccse.ogc.edu> schaefer@ogccse.UUCP (Barton E. Schaefer) writes: } > mush> pipe sed -n 1,/\^\$/p >> file } ... } > "pipe" does not write the ignored headers ("ignore" command or "show_hdrs" } > variable). If you want to save ALL the headers, you have to do a little } > more work: } > mush> set print_cmd='sed -n 1,/\^\$/p >> file' } > mush> lpr } } Not to be picky, but this sounds more like the "lpr" command is unneeded, } and that "pipe" needs additional work. I.e., perhaps there should be an } option to pipe, "-a"(?), which says "even send all headers". Then } "lpr" just becomes an alias using "pipe -a", and the mechanism pipe out } complete messages becomes much cleaner. This has already been under discussion for some days, originally for other reasons, but nobody has time to work it out at the moment. I should mention that there is an error in the "sv_hdrs" cmd that I included in the original article. If given a list of several messages, it will save the headers only of the first, because "lpr" starts only one "print_cmd" process and sends all the messages to it separated by form feeds. (A difference from "pipe" that presently does make the "lpr" command needed.) To make sv_hdrs work correctly for a list of messages, substitute the variable "pager" for "print_cmd" and substitute the command "print" for "lpr". You probably want to save the original value of $pager in another variable and restore it afterwards. -- Bart Schaefer "And if you believe that, you'll believe anything." -- DangerMouse CSNET / Internet schaefer@cse.ogc.edu UUCP ...{sequent,tektronix,verdix}!ogccse!schaefer