UNIX For Dummies [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

UNIX For Dummies [Electronic resources] - نسخه متنی

John Levine, Margaret Levine Young

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Chapter 17.
Real-time terminal communication has been likened to talking to someone on the moon because it’s so slow: It’s limited by the speed at which people type. Here on Earth, because most of us have telephones, the most sensible thing to do is to send a one-line message asking the other user to call you on the phone.

The simpler real-time communications command is write . If someone writes to you, you see something like this on your screen:

Message from johnl on iecc (ttyp1) [ Wed Jan 6 20:28:42 ] ...
Time for pizza. Please call me at extension 8649
<EOT>


Usually the message appears in the middle of an editor session and scrambles the file on your screen. You will be relieved to know that the scrambling is limited to the screen — the editor has no idea that someone is writing to you. The file is okay.

Tip In either vi or emacs , you can tell the editor to redraw what’s supposed to be on-screen by pressing Ctrl+L (if you’re in input mode in vi , press Esc first).

To write to a user, use the write command and give the name of the user to whom you want to talk:


write dguertin

After you press Enter, write tells you absolutely nothing, which means that it is waiting for your message. Type the message, which can be as many lines long as you want. When you finish, press Ctrl+D (the general end-of-input character) or the interrupt character, usually Ctrl+C or Delete. Because the write command copies every line to the other user’s screen as you press Enter, reading a long message sent by way of the write command is sort of like reading a poem on old Burma-Shave signs as you drive by each one.

You want to send an important message, for example, to your friend Dave, so you type these lines:


write dguertin
Yo, Dave, turn on your radio. WBUR is rebroadcasting
Terry Gross’s interview with Nancy Reagan!

You press Enter at the end of each line. After the last line, you press Ctrl+D.


I’m talking — where are you?


Sometimes write tells you that the user is logged in on several logical terminals:

dguertin is logged on more than one place.
You are connected to "vt01".
Other locations are:
ttyp1
ttyp0
ttyp2
Tip The write command is pretty dumb. If the person you are writing to is logged in on more than one terminal — or, more typically, is using many windows in X —

write picks one of them at random and writes there. You can be virtually certain that the window or terminal write chooses is not the one the user is viewing at the time. To maximize the chances of the user’s seeing your message, use the finger command to figure out which terminal is most active (the one with the lowest idle time) and write to that window. Remember the results of the finger command, for example, from a few pages back:

Login Name TTY Idle When Office
root 0000-Admin(0000) co 1:11 Tue 20:16
dguertin David S. Guertin vt 1:11 Mon 15:19
dguertin David S. Guertin vt 1:35 Tue 16:47
dguertin David S. Guertin p2 1:11 Wed 16:36
dguertin David S. Guertin p1 Wed 17:20
dguertin David S. Guertin p0 Wed 16:36
The best candidates to send a message to are ttyp1 and ttyp0 . (The finger command cuts the tty from terminal names.) To write to a specific terminal, give write the terminal name after the username:


write dguertin ttyp1

If you are writing back to a user who just wrote to you, you should use the terminal name that was sent in his write message (in this case, it was also ttyp1 ).


Can we talk?


You can have a somewhat spiffier conversation with the talk command, which allows simultaneous two-way typing. You use it the same way you use write : by giving a username and, optionally, a terminal name:


talk margy

The other user sees something like this:

Message from Talk_Daemon@iecc at 20:47 ...
talk: connection requested by johnl@IECC
talk: respond with: talk johnl@IECC
If someone tries to talk to you and you’re interested in responding, type the talk command it suggests. If you’re in the middle of a text editor or other program, you must exit to the shell first.

While talk is running, it splits your screen and arranges things so that what you type appears in the top half and what the other user types appears in the bottom half. Unlike write , talk immediately passes what you type — without waiting for you to press Enter — which means that you can see all the other user’s typing mistakes and vice versa. When you get tired of talk , exit by pressing Ctrl+D.


Chatting with faraway folks


The talk command is designed to "talk" to users on other computers. If the other computer is a long way away, typing rather than talking over the telephone can make sense. As the Internet stretches around the world, you may find yourself exchanging messages with someone for whom English is not a native language. In that case, typing can be faster than trying to understand someone with a strong accent across a noisy phone connection.

Computers have names, too, which are usually called machine names (more about this in Chapter 16). To talk to someone on another computer, give talk the username and machine name:


talk zac@greattapes.com

After you’re connected, talk works just like talking to a local user, except that sometimes several seconds can pass for characters to get from one machine to another on an intercontinental link.
Tip If you want to talk to a number of other people, maybe thousands and thousands of them, you can use a system called Internet Relay Chat (IRC). We don’t have room to describe it in this book, but you can read about it at our Web site:

http://net.gurus.com/irc
If you don’t know how to find this Web site, see Chapter 18.


Reading the writing on the wall


For the truly megalo-maniacal among you, a program called wall blats what you type to every single terminal and window on your entire computer. You use it much like write :


wall
Free pizza in the upstairs conference room in 5 minutes!

As with write , you tell wall that you’re finished by pressing Ctrl+D. Be sparing in your use of wall unless you want a bunch of new enemies. Note that wall affects only the people who use your computer, not everyone on your network (or on the whole Internet).

/ 213