You can obtain the source code for the programs presented in this book from O'Reilly & Associates through their Internet server. The example programs in this book are available electronically in a number of ways: by 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. Use FTP if you are directly on the Internet. Use Ftpmail if you are not on the Internet, but can send and receive electronic mail to Internet sites (this includes CompuServe users). Use BITFTP if you can send electronic mail via BITNET. Use UUCP if none of the above works.
The file is a gzip compressed tar archive; extract the files from the archive by typing:
System V systems require the following tar command instead:
If gzcat is not available on your system, use separate gunzip and tar commands.
Ftpmail is a mail server available to anyone who can send 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 email@example.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 if there's a later version of the examples you're interested in.
A signature at the end of the message is acceptable as long as it appears after "quit."
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.
serves only users who send it mail from nodes that are directly on
BITNET, EARN, or NetNorth. To use BITFTP, send mail containing your
. For a complete help file, send
FTP ftp.oreilly.com NETDATA USER anonymous PASS firstname.lastname@example.org Put your Internet email address here (not your BITNET address) CD /published/oreilly/nutshell/sedawk_2 DIR BINARY GET progs.tar.gz QUIT
Once you've got the desired file, follow the directions under FTP to extract the files from the archive. Since you are probably not on a UNIX system, you may need to get versions of uudecode , gunzip , atob , and tar for your system. VMS, DOS, and Mac versions are available.
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. If you or your company has an account with UUNET, you have a system somewhere with a direct UUCP connection to UUNET. Find that system, and type:
uucp uunet\!~/published/oreilly/nutshell/sedawk_2/progs.tar.gz yourhost\!~/yourname/
The backslashes can be omitted if you use a Bourne-style shell ( sh , ksh , bash , zsh , pdksh ) instead of csh or tcsh . 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, but would like one so that you can get electronic mail, contact UUNET at 703-206-5400. It's a good idea to get the file /published/oreilly/ls-lR.Z as a short test file containing the filenames and sizes of all the files available. Once you've got the desired file, follow the directions under FTP to extract the files from the archive.