Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!phoenix!pfalstad From: pfalstad@phoenix.Princeton.EDU (Paul John Falstad) Newsgroups: comp.unix.questions Subject: Re: Stripping a mail header Message-ID: <2880@idunno.Princeton.EDU> Date: 27 Sep 90 21:16:27 GMT References: <4011@umbc3.UMBC.EDU> Sender: news@idunno.Princeton.EDU Organization: Princeton University, Princeton, New Jersey Lines: 19 In article scott@tab00.larc.nasa.gov (Scott Yelich) writes: >awk '$1 == "From" && NF == 7 && HEADER == 0 {HEADER=1;}\ > HEADER == 0 {print $0 }\ > NF == 0 {HEADER=0;}' >You can put that in a pipe and what comes out the other side will be >the body of the message. Switch ``HEADER == 0'' to ``HEADER == 1'' >and you will only get the headers! Or, try this: sed '/^From/,/^$/d' mailfiles ... To get the headers: sed -n '/^From/,/^$/p' mailfiles ... Paul Falstad, pfalstad@phoenix.princeton.edu PLink:HYPNOS GEnie:P.FALSTAD I'd like to answer this question, if I may, in two ways. Firstly in my normal voice, and then in a kind of silly high-pitched whine.