Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!tut.cis.ohio-state.edu!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!ucsd!ucbvax!ENG.UMD.EDU!ziegast From: ziegast@ENG.UMD.EDU (Eric Ziegast) Newsgroups: comp.mail.mh Subject: Re: changing a path for the inc command only Message-ID: <9012161856.AA15028@bacchus.eng.umd.edu> Date: 16 Dec 90 18:56:53 GMT References: <1990Dec14.154913.22032@porthos.cc.bellcore.com> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 42 "Laura R. Pate" writes: >I am setting up a mail group for several users and would like to offer >them a way to automatically refile mail from a particular source >when inc is invoked. I want this to be as transparent to them as possible. >I've put together a shell script (my thanks to Jerry Peek) that calls >inc, scans >the messages and refiles according to the 'to' field. I can alias this >script to inc and have it work as I'd like, but I have two problems/questions: Using shell scripts is the best way to go if you don't want to reinvent the wheel (MH). I envy Jerry in his mastering of sh & mh to create new commands out of old. >1- is there a better way to do this? Could I somehow change where mh >looks for inc? MhPath changes where it looks for all mh commands and I >don't want to get into having a separate set of mh commands (or even a >separate directory link) just for these users. Why not? With a new directory, you can just add an entry to the PATH variable rather than a zillion aliases for your new scripts. For example, if you have a directory called /usr/local/bin/mh on your system, you can create a directory called /usr/local/bin/mh/bin/new, stick your new shell scripts in there, and have the people in the mail group prepend the bin/new directory to their PATH variable in their .cshrc file. That way any time a command is searched for using PATH, the new commands will be found before the standard ones. Normal users not in the mail group won't have to add the new directory. >2- There are also xmh users and I'd like to change where xmh looks for >inc too. Just aliasing it doesn't work in this case. If I'm not mistaken, xmh should use execvp(2) or execlp(2) like any other good Unix program. In this case, the PATH variable is searched for the command to use. Be careful though; your shell scripts should take all of the arguments of the origional commands so as to provide 100% compata- bility for other programs (like xmh,msh,vmh,emh,etc) to use. Hope this helps. ________________________________________________________________________ Eric W. Ziegast, University of Merryland, Engineering Computing Services ziegast@eng.umd.edu - Eric@(301.405.3689)