Web page hosting and cheap domain registration & search engine ranking services
  

 

The resend.fixmsg Shell Script

[return-to Explanation of resend] [table of contents] [index]

#! /bin/sh
# $Id: resend.fixmsg,v 1.6 92/07/24 18:23:58 jerry book2 $
### resend.fixmsg - editor for fixing up returned mail
### Usage in MH profile:  resend: -editor resend.fixmsg -nodashmunging
###   MUST ALSO ADD:   -format   OR   -filter xxx
##
##  TO USE THIS, FIRST MAKE A VERSION OF forw NAMED resend
##  (MAKE SYMBOLIC LINK TO forw, ETC.).  THEN, ADD THE ENTRY
##  SHOWN ABOVE TO YOUR MH profile file.
##
##  WHEN YOU START resend, IT BUILDS A DRAFT AND CALLS
##  resend.fixmsg TO EDIT IT.  resend.fixmsg MAKES THE MESSAGE
##  LOOK ALMOST EXACTLY AS IT DID THE FIRST TIME YOU COMPOSED
##  IT, THEN STARTS AN EDITOR (DEFAULT: vi) TO FIX THE ADDRESS.

# $1 IS PATH TO DRAFT (SET BY forw).  THEN ed SCRIPT:
# DELETES LINES THROUGH FIRST "To: (you)".
# DELETES LINES TO BUT NOT INCLUDING NEXT "To: (original)".
# REMOVES Date:/From:/Sender: LINES THAT MAILER PUT IN MESSAGE.
# REMOVES FROM BLANK LINE BEFORE "---- End of Forwarded Message"
#   THROUGH THE END OF THE FILE.
/bin/ed - $1 << "END"
1,/^To: /d
1,/^To: /-1d
1,/^$/g/^Date: /d
1,/^$/g/^From: /d
1,/^$/g/^Sender: /d
$
?^------- End of Forwarded Message?-1,$d
w
q
END

# EDIT WITH $VISUAL, $EDITOR OR vi.  exec TO SAVE A PROCESS:
exec ${VISUAL-${EDITOR-vi}} $1
 

 

 

 
 

Disclaimers: This document is provided as free service for the benefits of Active-Venture.com's web hosting customers only.

 
Quotes: