Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!oliveb!sun!trantor!smarks From: smarks%trantor@Sun.COM (Stuart Marks) Newsgroups: comp.mail.mh Subject: Re: turning news articles into MH messages Message-ID: <37490@sun.uucp> Date: 29 Dec 87 18:27:43 GMT References: <207@ksr.UUCP> Sender: news@sun.uucp Reply-To: smarks@sun.UUCP (Stuart Marks) Organization: Sun Microsystems, Inc. Lines: 54 In article <207@ksr.UUCP> benson@ksr.UUCP (Benson I. Margulies) writes: >has anyone got a quick way to turn a news posting read in rn into a >mail message in MH? Yes! I have a very simple shell script "mhcp" that copies stdin to a new message at the end of the specified folder. It requires that you have the "mhpath" command, which is present in MH 6.5. (I don't know if it's present in earlier versions.) I also have a couple of rn macros that invoke mhcp from within rn. The '!' macro causes the current article to be appended to the folder "+news", while the '@' macro lets you specify the folder to which the article will be appended. (Note that these macros don't check to see whether you're in the proper one of rn's zillion modes. I didn't feel like adding all the conditional garbage.) So, if I'm running rn and I run across an article I want to save, I merely hit ! and it's saved in a jiffy! Here's a shell archive with the mhcp script and the rn macros. Stuart ================================ cut here ================================== #! /bin/sh # This is a shell archive. To extract, cut everything above # the "#! /bin/sh" line and run the rest through sh. ## mhcp echo '=>' mhcp cat > mhcp << '1930!Funky!Stuff!' #! /bin/sh # mhcp - copy stdin to a new mh article # Usage: mhcp [+folder] if [ $# -eq 0 ]; then set +news fi outfile=`mhpath $* new` echo "==> $outfile" cat - > $outfile 1930!Funky!Stuff! chmod +x mhcp ## rnmac echo '=>' rnmac cat > rnmac << '1930!Funky!Stuff!' ! | mhcp +news\nn @ | mhcp + 1930!Funky!Stuff! exit # End of shell archive. ================================ cut here ================================== Stuart Marks ARPA: smarks@sun.com Window Systems Group UUCP: {decwrl,ucbvax}!sun!smarks Sun Microsystems, Inc.