$book = '..'?>
include "$book/mh.php"; includeHeader('../xmh/e-edprof.html', 'e-fols.html'); ?>The execit program lets you make multiple versions of MH commands. For an introduction, see the Section Setup Before You Make First New Version. You can see the program and include files by clicking on the links in the text below (you might want to open them in a separate browser window).
The main program, execit.c, is written in the original (pre-ANSI) C programming language; you may need to do a little editing if you have an ANSI C compiler that doesn't understand "old C." The other files are:
As Chapter 10 explains, MH programs check the name they're invoked with (from their argv[0]) and change the way they work. The easiest way to make this happen with system programs is to make a new link (symbolic or "hard") to the program's executable code, like this:
% ln /usr/local/bin/folder /usr/myhome/bin/folderzThen, you can run folder with the name folderz.
That method has some problems. You can only make hard links (ln) if you have access to a directory on the same filesystem as the system executables. And some systems don't have symbolic links (ln -s). That's when you need execit. execit lets you define a table of system commands and the names you want to run them with. Then, you make a link to execit with the name of the program you want to run. It invokes the system program with the name you use. This way, you get fast execution of a system program with your own name. And, if you make new hard links to execit to define new program names, the links take almost no more filesystem space.
Here's an example of how to set up execit so it will run the program /usr/local/mh/repl, but make repl think its name is replx:
"replx", "/usr/local/mh/repl",The second string should be where repl is located on your system. (the Chapter Key Parts of the UNIX Filesystem has more information.) Be sure to make the line look just like that: quotes (") and commas (,). The execit.include file is read into the xref structure when you compile execit.c; the execit.link script also reads it.
% cc -o execit execit.c
ln execit replxIf you run ls -li, you can be sure previous links to execit still exist:
% ls -li execit replx tscan 2379 -rwx------ 3 jdpeek 35982 Feb 10 22:14 execit 2379 -rwx------ 3 jdpeek 35982 Feb 10 22:14 replx 2379 -rwx------ 3 jdpeek 35982 Feb 10 22:14 tscan ^^^^ ^ ^^^^^^^^^^^^ SAME SAME TODAY'S i-NUMS LINK COUNT DATE AND TIMEDelete any old links (that you've removed from the execit.include file).
replx: -switches -go -hereNow, assuming the directory with the links is in your shell's search path, you can run replx and pass the switch -query to it this way:
% replx -query
The execit.link shell script reads the execit.include file and automatically builds the links to execit. When you first install execit.link, you'll need to edit this line for your system:
dest=/xxx/yyy/bin # WHERE YOUR LINKS SHOULD GOincludeFooter('$Date: 2006-05-31 15:13:43 -0700 (Wed, 31 May 2006) $', 'OReilly: 1991, 1992, 1995; Jerry: 1996, 1997, 1999, 2000, 2002, 2004'); ?>