Obtaining Example Files From This Book

[previous] [next] [table of contents] [index]

The example programs in this book are available electronically in a number of ways: by http, ftp, ftpmail, bitftp, and uucp. The cheapest, fastest, and easiest ways are listed first. If you read from the top down, the first one that works for you is probably the best. If you are directly on the Internet, use a Web browser (like Mosaic), Gopher, or FTP. Use ftpmail if you are not on the Internet but can send and receive electronic mail to Internet sites. Use BITFTP if you send electronic mail via BITNET. Use UUCP if none of the above works.

World Wide Web

O'Reilly & Associates has a Web server with our book example files and other information. As this book went to press early in 1995, we were experimenting with the format.

On the Web, examples may be obtained at this URL: http://ftp.ora.com/MHxmh/

You can always get to the FTP archive, ftp://ftp.oreilly.com/published/oreilly/nutshell/MHxmh/, by pointing your Web browser there. In all cases, you can keep a copy of the files with your browser's "save to file" command.


To use FTP, you need a machine with direct access to the Internet. A sample session is shown, with what you should type in boldface.
% ftp ftp.uu.net
Connected to ftp.uu.net.
220 FTP server (Version 6.21 Tue Mar 10 22:09:55 EST 1992) ready.
Name (ftp.uu.net:nicole): anonymous
331 Guest login ok, send domain style e-mail address as password.
Password: nicole@ora.com (use your user name and host here)
230 Guest login ok, access restrictions apply.
ftp> cd /published/oreilly/nutshell/MHxmh
250 CWD command successful.
ftp> binary (Very important! You must specify binary transfer for compressed files.)
200 Type set to I.
ftp> get MHxmh3.tar.Z
200: PORT command successful.
150 Opening BINARY mode data connection for MHxmh3.tar.Z.
226 Transfer complete.
ftp> quit
221 Goodbye.
The file is a compressed tar archive. Extract the files from the archive by typing:
% zcat MHxmh3.tar.Z | tar xf -
System V systems require the following tar command instead:
% zcat MHxmh3.tar.Z | tar xof -
If zcat is not available on your system, use separate uncompress and tar commands.


Ftpmail is a mail server available to anyone who can send and receive electronic mail to, and receive it from, Internet sites. This includes any company or service provider that allows email connections to the Internet. Here's how you do it.

You send mail to ftpmail@online.oreilly.com. In the message body, give the FTP commands you want to run. The server will run anonymous FTP for you and mail the files back to you. To get a complete help file, send a message with no subject and the single word help in the body. The following is a sample mail session that should get you the examples. This command sends you a listing of the files in the selected directory and the requested example files. The listing is useful in case there's a later version of the examples you're interested in.

% comp
To: ftpmail@online.oreilly.com
reply-to janet@xyz.com      (where you want files mailed)
chdir /published/oreilly/nutshell/MHxmh
mode binary
uuencode                       (or btoa if you have it)
get MHxmh3.tar.Z

What now? send
If you have MIME installed, you can replace the uuencode command with mime. The server will send the file with MIME base64 encoding and split it into several message/partial parts if needed.

All retrieved files will be split into chunks and mailed to you. Unless you use MIME, where the conversion will be automatic, you remove the mail headers and concatenate the bodies into one file, and then uudecode it. Once you've got the desired file, follow the directions under FTP to extract the files from the archive.


BITFTP is a mail server for BITNET users. You send it electronic mail messages requesting files, and it sends you back the files by electronic mail. BITFTP currently serves only users who send it mail from nodes that are directly on BITNET, EARN, or NetNorth. BITFTP is a public service of Princeton University. Here's how it works.

To use BITFTP, send mail containing your ftp commands to BITFTP@PUCC. For a complete help file, send HELP as the message body.

The following is the message body you should send to BITFTP:

FTP  ftp.uu.net  NETDATA
USER  anonymous
PASS your Internet email address (not your BITNET address)
CD  /published/oreilly/nutshell/MHxmh
GET MHxmh3.tar.Z

Once you've got the desired file, follow the directions under FTP to extract the files. Since you are probably not on a UNIX system, you may need to get versions of uudecode, uncompress, btoa, and tar for your system. VMS, DOS, and Mac versions are available. The VMS versions are on gatekeeper.dec.com in /archive/pub/VMS.

Questions about BITFTP can be directed to Melinda Varian, MAINT@PUCC on BITNET.


UUCP is standard on virtually all UNIX systems, and is available for IBM-compatible PCs and Apple Macintoshes. The examples are available by UUCP via modem from UUNET; UUNET's connect-time charges apply.

You can get the examples from UUNET whether you have an account or not. If you or your company has an account with UUNET, you will have a system with a direct UUCP connection to UUNET. Find that system, and type:

uucp uunet\!~/published/oreilly/nutshell/MHxmh/MHxmh3.tar.Z yourhost\!~/yourname/
The backslashes can be omitted if you use the Bourne shell (sh) instead of csh. The file should appear some time later (up to a day or more) in the directory /usr/spool/uucppublic/yourname. If you don't have an account, contact UUNET at +1-703-204-8000.

It's a good idea to get the file /published/oreilly/nutshell/ls-lR.Z as a short test file containing the filenames and sizes of all the files in the directory.

Once you've got the desired file, follow the directions under FTP to extract the files from the archive.

[Table of Contents] [Index] [Previous: Appendix Introduction (Example Files and Programs)] [Next: FAQ]

Last change $Date: 1996/06/06 16:36:12 $

This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright © 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.

Suggestions are welcome: Jerry Peek <jpeek@jpeek.com>