\chapter{Talking to Others}\label{network-chapter}

% should we cover Mosaic?

\begin{quote}
``One basic notion underlying Usenet is that it is a cooperative.''

Having been on Usenet for going on ten years, I disagree with
this. The basic notion underlying Usenet is the flame.\\
\raggedleft Chuq Von Rospach
\end{quote}

\unix\ networks extremely well. Two different \unix\ computers can
exchange information is many, many different ways.  This chapter is
going to try to talk about how you can take advantage of strong
network ability.

We'll try to cover electronic mail, Usenet news, and several basic
\unix\ utilities used for communication.

\section{Electronic Mail}

One of the most popular standard features of \unix\ is electronic
mail. With it, you are spared the usual hassle of finding an envelope,
a piece of paper, a pen, a stamp, and the postal service.

\subsection{Sending Mail}

All you need to do is type {\tt mail {\sl username}}\impttindex{mail}
and type your message.

For instance, suppose I wanted to send mail to a user named {\tt sam}:

\begin{screen}\begin{verbatim}
/home/larry# mail sam
Subject: The user documentation
Just testing out the mail system.
EOT
/home/larry#
\end{verbatim}\end{screen}

The {\tt mail}\ttindex{mail} program is very simple. Like {\tt cat},
it accepts input from standard input, one line at a time, until it
gets the end-of-text character on a line by itself: \eof. So, to send
my message off I had to hit return and then \eof.

{\tt mail} is the quickest way to send mail, and is quite useful when
used with pipes and redirection. For instance, if I wanted to mail
the file {\tt report1} to ``Sam'', I could {\tt mail sam < report1},
or I could have even run ``{\tt sort report1 | mail sam}''.

However, the downside of using {\tt mail} to send mail means a very
crude editor. You can't change a line once you've hit return! So, I
recommend you send mail (when not using a pipe or redirection) is with
Emacs's\index{Emacs} mail mode.  It's covered in
Section~\ref{emacs-mail-mode}.

\subsection{Reading Mail}

The {\tt mail} program offers a clumsy way of reading mail. If you
type {\tt mail} without any parameter, you'll see the following:

\begin{screen}\begin{verbatim}
/home/larry# mail
No mail for larry
/home/larry#
\end{verbatim}\end{screen}

I'm going to send myself some mail so I can play around with the
mailreader:

\begin{screen}\begin{verbatim}
/home/larry# mail larry
Subject: Frogs!
and toads!
EOT
/home/larry# echo "snakes" | mail larry
/home/larry# mail
Mail version 5.5 6/1/90.  Type ? for help.
"/usr/spool/mail/larry": 2 messages 2 new
>N  1 larry                 Tue Aug 30 18:11  10/211   "Frogs!"
 N  2 larry                 Tue Aug 30 18:12   9/191  
& 
\end{verbatim}\end{screen}

The prompt inside the mail program is an ampersand (``{\tt \&}''). It
allows a couple of simple commands, and will give a short help screen
if you type {\tt ?} and then \ret.

The basic commands for {\tt mail} are:

\begin{dispitems}
\item [{\tt t} {\sl message-list}] Show (or {\bf t}ype) the messages
  on the screen.
\item [{\tt d} {\sl message-list}] Delete the messages.
\item [{\tt s} {\sl message-list} {\sl file}] Save the messages into
  {\sl file}.
\item [{\tt r} {\sl message-list}] Reply to the messages---that is,
  start composing a new message to whoever sent you the listed
  messages.
\item [{\tt q}] Quit and save any messages you didn't delete into a
  file called {\tt mbox} in your home directory.
\end{dispitems}

What's a {\sl message-list}? It consists of a list of integers
seperated by spaces, or even a range, such as {\tt 2-4} (which is
identical to ``{\tt 2 3 4}''). You can also enter the username of the
sender, so the command {\tt t sam} would {\bf t}ype all the mail from
Sam. If a message list is omitted, it is assumed to be the last
message displayed (or typed).

There are several problems with the {\tt mail} program's reading
facilities. First of all, if a message is longer than your screen, the
mail program doesn't stop! You'll have to save it and use {\tt more}
on it later. Second of all, it doesn't have a very good interface for
old mail---if you wanted to save mail and read it later.

Emacs also has a facility for reading mail, called {\tt rmail}, but it
is not covered in this book. Additionally, most Linux systems have
several other mailreaders available, such as {\tt elm}\ttindex{elm} or
{\tt pine}\ttindex{pine}.

\section{More than Enough News}

% nn?

\section{Searching for People}

% finger

\section{Using Systems by Remote}

% telnet, rlogin

\xwarn If you're using X, let's create a new {\tt xterm} for the other
system we're travelling to. Use the command ``{\tt xterm -title
  "lionsden" -e telnet lionsden \&}''\ttindex{xterm}. This will create
a new {\tt xterm} window that's automatically running {\tt telnet}.
(If you do something like that often, you might want to create an
alias or shell script for it.)

\section{Exchanging Files on the Fly}

% ftp

% Local Variables: 
% mode: latex
% TeX-master: "guide"
% End: 
