home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume12 / cnews / part01 / lib.proto / newsreply.from < prev    next >
Encoding:
Text File  |  1987-10-19  |  344 b   |  21 lines

  1. #! /bin/sh
  2. # newsreply - print return address from news article on stdin
  3. # This version assumes a domain mailer (user@host.domain works)
  4. F=/tmp/nc$$
  5.  
  6. cat >$F
  7.  
  8. SENDER="`grep '^Reply-To:' $F | sed 's/^[^:]*://
  9. s/ (.*)//
  10. 1q' `"
  11. case "$SENDER" in
  12. "")
  13.     SENDER="`grep '^From:' $F | sed 's/^[^:]*://
  14. s/ (.*)//
  15. 1q' `"
  16.     ;;
  17. esac
  18.  
  19. echo "$SENDER"
  20. rm -f $F
  21.