#!/bin/csh -f # h2: chops the head off mail files rm -f top1 top2 body1 foreach i ($*) if(-f ${i}) then sed -e '1,/^$/\!d' ${i} > top1 cat top1 |grep ^From: > top2 cat top1 |grep ^Subject: >> top2 cat top1 |grep ^Date: >> top2 cat top1 |grep ^To: >> top2 if(-z top2) then echo this is not mail file goto saigo endif echo "" >body1 sed -e '1,/^$/d' ${i} >> body1 mv -f body1 ${i} saigo: rm -f top1 top2 endif end