可通过FTP和FTPMAIL方式得到本书的一些例子。如果连接了Internet,可使用FTP。如果未连接Internet但可以发送并接收电子邮件到Internet站点上,可使用FTPMAIL。
**FTP
如果你具有Internet连接(永久或拨号),最简单的使用FTP的方式是通过web浏览器或FTP客户端。要得到例子,可以访问ftp://ftp.oreilly.com/published/oreilly/nutshell/bash/examples.tar.gz。如果你没有web浏览器,可以使用Windows NT或Windows 95包含的命令行FTP客户端访问。
示例如下,黑体代码是你应该键入的内容。
% ftp ftp.oreilly.com
Connected to ftp.oreilly.com.
220 FTP server (Version 6.21 Tue Mar 10 22:09:55 EST 1992) ready.
Name (ftp.oreilly.com:username ): anonymous
331 Guest login OK, send email address as password.
Password: username@hostname (在这里使用你自己的用户名和主机名)
230 Guest login OK, access restrictions apply.
ftp> cd /published/oreilly/nutshell/bash
250 CWD command successful.
ftp> binary (非常重要!必须对压缩文件指定二进制传输模式)
200 Type set to I.
ftp> get examples.tar.gz
200 PORT command successful.
150 Opening BINARY mode data connection for examples.tar.gz (xxxx bytes).
226 Transfer complete. local: exercise remote: exercises
xxxx bytes received in xxx seconds (xxx Kbytes/s)
ftp> quit
221 Goodbye.
%
**FTPMAIL
FTPMAIL是一个邮件服务器。只要你可以向因特网站点发送电子邮件并可以从Internet站点接收邮件,你就可以使用它。任何允许通过电子邮件连接到Internet的公司或服务提供商都可以访问FTPMAIL。
你可以发送邮件到ftpmail@online.oreilly.com。在消息体中,给出匿名FTP主机的名字以及你要运行的FTP命令。服务器会为你运行匿名FTP,并发送邮件文件返回给你。要得到完整的帮助文件,可以发送没有主题的消息,体中只有一个单词“help”。以下是可以得到示例的邮件例子。该命令向你发送所选择的目录里的文件列表以及所请求的示例文件。如果你对示例的后续版本感兴趣,该列表是有用的。
Subject:
reply-to username@hostname (你希望文件寄到的地址)
open
cd /published/oreilly/nutshell/bash
dir
mode binary
uuencode
get examples.tar.gz
quit
.
消息结尾处出现在“quit”后的记号是可接受的。