jdpeek@RODAN.ACS.SYR.EDU (Jerry Peek) (11/22/89)
I've always used MH on a Berkeley UNIX system. Since 4.2BSD, I've used
symbolic links to let me rename MH commands and make my own versions:
% ln -s /usr/local/mh/repl ~/bin/myrepl
I'm writing a generic document about MH, and I'm wondering how people
do this on systems without symbolic links. Maybe I didn't RT the right
FM :-), but I can't find the answer to a big problem: You can only use
regular ("hard") links if the MH binaries are on the same filesystem as
the users' directories. How do you get around that? Do you:
- Write a C program that checks its own name and then exec's the
correct MH program?
- Make a local copy (on the user disk) of the MH binaries you want
to use, and then let all the users link to that local copy?
- Ask the sysadmin to make the link on the disk with the binaries?
- Do something else I haven't thought of?
Thanks for the help.
--Jerry Peek; Syracuse University Academic Computing Services; Syracuse, NY
jdpeek@rodan.acs.syr.edu///JDPEEK@SUVM.BITNET///GEnie: J.PEEK1
+1 315 443-3995
---------------------------------------------------------------------------
P.S. In case you haven't seen this trick, it's really useful. Let's
say that I want to make a command called "thanks" that automatically
sends a reply saying "Thanks." First, I make a symbolic link named
"thanks" to the "repl" command, like this:
% ln -s /usr/local/mh/repl ~/bin/thanks
Then, I put a line in my .mh_profile that sets the repl flags for thanks:
thanks: -form thankscomps -annotate -editor cat -query
Finally, I put a format file called "thankscomps" in my Mail directory:
%(lit)%(formataddr{reply-to})%(formataddr{return-path})%(formataddr{from})%(formataddr{sender})\
%<(nonnull)%(void(width))%(putaddr To: )\n%>\
%(lit)%(formataddr{to})%(formataddr{cc})%(formataddr(me))\
%<(nonnull)%(void(width))%(putaddr cc: )\n%>\
%<{subject}Subject: Re: %{subject}\n%>\
%<{date}In-reply-to: Your message of \
%<(nodate{date})%{date}%|%(tws{date})%>.%<{message-id}
%{message-id}%>\n%>\
--------
Thanks...
--Jerry
Now, to send a reply saying "Thanks...", I just type:
% thanks
I think this idea originally came from Marshall Rose.marvit%hplpm@HPLABS.HP.COM (Peter Marvit) (11/23/89)
[[ Jerry Peek asks how to "rename" MH comands on systems without symbolic
links ]]
My solution in days of yore was to create a small shell script with the
name I wanted and put the appropriate MH invocation. To use Jerry's
example, the file ~/bin/thanks would contain:
#!/bin/sh
#Give thanks
repl -form thankscomps -annotate -editor cat -query
The rest would be the same. Performance is a bit worse than the symbolic
link, but the interface is still quite clean. The main problem is that you
must remember customize the script, rather than .mh_profile.
-Peter "Thanks goodness MH is stable ;-)" Marvit
: Peter Marvit Hewlett-Packard Labs in Palo Alto, CA (415) 567-6883 :
: Internet: <marvit@hplabs.hp.com> uucp: {any backbone}!hplabs!marvit :