Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!orion.oac.uci.edu!ucivax!jromine From: jromine@buckaroo.ics.uci.edu (John Romine) Newsgroups: comp.mail.mh Subject: Re: comp option addition request Keywords: comp, option, fcc, to, subject Message-ID: <275C2953.28092@ics.uci.edu> Date: 4 Dec 90 22:55:15 GMT References: <1990Dec4.203315.139@ux1.cso.uiuc.edu> Reply-To: jromine@ics.uci.edu (John Romine) Organization: UC Irvine Department of ICS Lines: 61 Nntp-Posting-Host: buckaroo.ics.uci.edu daniel@ux1.cso.uiuc.edu (Daniel Pommert) writes: >This is a request for comments on the idea of adding the -fcc flag, as >it appears on repl to the comp command. In a similar vein, I feel that >it would be nice if the -to and -subject options would be added to >comp. The components file would need to be parsed in a similar way to >replcomps so that the existence of %{fcc}, %{to} and %{subject} could >be properly handled. > >Is there any other way of doing this presently with mh? Was there some >important reason that these options are not already present in comp? The answer is because you can do this with a shell script. We have resisted with medium to poor :-( success adding more switches to MH commands. Instead, we tried to give the MH commands more general functionality, which shell programmers could exploit. MH-format(5) is an example. Comp is designed to be used interactively. If you're looking for a programmatic way to send mail, look at "mhmail". Here's a partial shell script which does some of what you asked. You can easily fill in the other switches you want it to accept. You could also parse all of comp's arguments if you don't the requirement that "-subject" and "-fcc" come first. Abbreviations could be added as well. /JLR : This is a shar archive. Extract with sh, not csh. : This archive ends with exit, so do not worry about trailing junk. echo 'Extracting mycomp' sed 's/^X//' > mycomp << '+ END-OF-FILE mycomp' X#! /bin/sh Xwhile : Xdo Xcase x$1 in X x-subject) shift; sub=$1;; X x-fcc) shift; fcc=$1;; X *) break;; Xesac Xshift Xdone X Xsed -e "/Subject:/s/\$/ ${sub}/" \ X -e "/Fcc:/s/\$/ ${fcc}/" </tmp/mycomp.$$ XTo: Xcc: XFcc: XSubject: X-------- XEOF X Xcomp -form /tmp/mycomp.$$ $* Xrm -f /tmp/mycomp.$$ + END-OF-FILE mycomp chmod 'u=rwx,g=rx,o=rx' 'mycomp' echo ' -rwxr-xr-x 1 jromine 290 Dec 4 14:52 mycomp (as sent)' echo -n ' ' /bin/ls -l mycomp exit 0 -- John Romine Brought to you by Super Global Mega Corp .com