3
<META NAME="Author" CONTENT="Jerry Peek">
4
<TITLE>MH & nmh: What's a New Command Version?</TITLE>
6
<!-- $Id: whacom.htm,v 6.0 1999/10/10 05:14:05 jpeek Exp $ -->
8
<BODY BGCOLOR="#FFFFFF">
10
<H1>What's a New Command Version?</H1>
11
[<A HREF="ch-nvomc.htm">previous</A>]
12
[<A HREF="makcom.htm">next</A>]
13
[<A HREF="tocs/jump.htm">table of contents</A>] [<A HREF="indexes/map.htm">index</A>]
16
In UNIX, you can give the same command more than one name.
17
For instance, typing the command <I>view</I> will run the <I>vi</I>
18
program -- but the program will notice that you've run it with the name
19
<I>view</I>, so it automatically sets its read-only mode.
20
You can do the same thing with MH programs.
21
(Besides this chapter,
22
there are some good examples in the <I>miscellany/mtrenv</I> directory
23
of the MH distribution.)
25
An MH command will run the same way, no matter what name you give
26
it -- but it will look for an entry in your MH profile
27
with the name you use to run it.
29
For example, you can set a second name for the <I>repl</I> command
30
called <I>replx</I> (see the directions below).
31
Then, add an entry with the new name to your MH profile.
34
replx: -query -filter <TT><I>filter_file</I></TT>
40
the program will run as if you'd typed
41
<TT>repl -query -filter <I>filter_file</I> 23</TT>
42
and read a copy of your original message into your draft reply.
44
New versions are easy to make -- almost as easy as shell aliases.
45
Usually, you don't even have to be a programmer.
46
(It might help to have a guru "on call" when you do the first setup.)
48
<A HREF="makcom.htm">Making a New Command Version</A> explains how to make them.
51
<A HREF="mhanthsh.htm#UsSAaFwM">shell aliases or functions</A>, MH command
52
versions can be run by any other MH or UNIX command.
53
You can use MH command versions in <I>at</I> or <I>cron</I> jobs, from
54
inside a shell script, from another MH command, from a C or <I>perl</I>
56
Sometimes, though, an alias or function is all you need.
58
<A HREF="wcvaaof.htm">Writing Command Versions as Aliases or Functions</A>
59
tells how to write these versions as an alias
64
[<A HREF="tocs/jump.htm">Table of Contents</A>] [<A HREF="indexes/map.htm">Index</A>]
65
[<A HREF="ch-nvomc.htm">Previous: Chapter Introduction (New Versions of MH Commands)</A>]
66
[<A HREF="makcom.htm">Next: Making a New Command Version</A>]
69
<EM>Last change $Date: 1999/10/10 05:14:05 $</EM>
71
This file is from the third edition of the book <I>MH & xmh: Email
72
for Users & Programmers</I>, ISBN 1-56592-093-7, by Jerry Peek.
73
Copyright © 1991, 1992, 1995 by O'Reilly & Associates, Inc.
74
This file is freely available; you can redistribute it and/or modify
75
it under the terms of the GNU General Public License as published by
76
the Free Software Foundation. For more information, see
77
<A HREF="../copying.htm">the file <I>copying.htm</I></A>.
80
Suggestions are welcome:
81
<A HREF="http://www.jpeek.com/">Jerry Peek</A>
82
<A HREF="mailto:jpeek@jpeek.com"><jpeek@jpeek.com></A>