| Previous | Table of Contents | Next |
APPLICATIONS
You use the mailx command to exchange information with other users. The information may be any ASCII text; for example, memos, notes, program source, data, documents, or whatever information you need to send. The users may be local or remote depending on how your system is set up. If you have links to other systems via a LAN or modem, you can send mail to users on other systems.
TYPICAL OPERATION
In this activity you use the mailx (mail on BSD) command to send yourself a short message. Begin at the shell prompt.
|
|
| BSD (Berkeley) |
|---|
| If you are on a BSD system use the /usr/ucb/mail command. You can use the which command to locate which mail command your PATH finds first. If it is /usr/ucb/mail, you can just type mail. Otherwise, change your PATH or type in the entire /usr/ucb/mail path. You may wish to set an alias to /usr/bin/mail. For example, place the following command in your .cshrc. |
alias mail /usr/bin/mail.
|
|
cj> mailx mylogin
Subject: _
cj> mailx mylogin
Subject: Sending mail to myself.
_
cj> mailx mylogin
Subject: Sending mail to myself.
April 22, 1989
Just thought I'd test the mailx command. So I'm sending myself a message. UNIX is a powerful
system of tools designed to increase productivity among computer users.
^D
cj>
In this activity you invoke mailx to read any mail stored in your mailbox. Start at the shell prompt. You should wait a few minutes before continuing, since the message may still be en route to your mailbox. This is unlikely but on extremely slow systems it is possible.
cj> mailx
mailx version 2.2 9/9/88. Type ? for help.
"/usr/mail/mylogin": 2 messages 2 unread
>O 1 bill Tue Apr 12 08:31 5/134 "cabling problems"
O 2 nancy Tue Apr 12 10:03 4/98 "lunch in the break area"
N 3 mylogin Wed Apr 13 09:41 6/213 "Sending mail to myself."
In this activity you send a file you created earlier to a user. Start at the shell prompt.
In this activity you create a .mailrc file to control how mailx function. Start at the shell prompt.
cj> vi .mailrc
i
set LISTER="ls -xs"
set MBOX=$HOME/mail/MBOX
set PAGER="pg -cn -p '/usr/mail/mylogin'"
set cmd="lp -dlaser"
set hold
set EDITOR=vi
set folder=$HOME/mail
<Escape>ZZ
|
|
|
| BSD (Berkeley) | |
|---|---|
| cj> vi .mailrc i set LISTER=ls set MBOX=$HOME/mail/MBOX set PAGER=more set cmd=lp set hold set EDITOR=vi set folder=$HOME/mail <Escape>ZZ |
|
|
|
|
The following activities will use some of the variables you set in the .mailrc file. In the following activity you use some tilde commands to help you generate a message.
cj> mailx nancy
Subject: Playing with the mailx command!
This is a brief message about tommorros big design meeting. I need to know if I should order two
dozen donuts or three? PLeas let me know as soon as possible. Thnaks
Myself
~e
/mm<CR> xfsiw<ESC> jfL~ fsae<ESC> jFnxp ZZ (continue)
(continue) Ctrl-D
| Previous | Table of Contents | Next |