URL.biz - where people find experts

 
HOME ARTICLES LIST NOW FOR FREE! ABOUT US CONTACT US LOG IN

Unix Fundamentals Module #6 Communication
6th in series of Unix Fundamentals Modules from JayrConsulting Ltd. A FREE copy of this module in MsWord format (including missing diagrams) can be got from john.roberts@jayrconsulting.co.uk

Go to Web Site

UNIX Fundamentals

MODULE 6 – Communicating with others



You will cover

* Using UNIX mail

þ Sending messages with write and wall

þ Using talk

þ Using message files





































































































MODULE 6 – CONTENTS

6. COMMUNICATING WITH OTHERS 4

6.1 USING UNIX MAIL 4

6.2 SENDING ON LINE MESSAGES WITH WRITE 5

6.3 BROADCAST MESSAGES WITH WALL 5

6.4 ENABLING/DISABLING MESSAGES 6

6.5 COMMUNICATING ON LINE WITH TALK 6







































6. Communicating with others



There are various methods available on UNIX for communicating with other users. Which ones are available for users will depend on specific system configuration and administration procedures.



6.1 Using UNIX mail



To send messages to another user, who is not currently logged on, or whose terminal is not accessible, the ‘mail' command may be used. To send mail give one or more user names as arguments. The message to send then may be entered. To terminate the message, enter as the last line.



mail jim sally

Jim,Sally don't forget the

Meeting today at 13:00

Regards, Jay





Note that the text to be sent is read from standard input and therefore shell redirection or pipelining may be used to mail the contents of a file or the result of a command.



mail jim sally


payroll|mail boss runs ‘payroll' program and sends result to ‘boss' via mail





The shell periodically checks for incoming mail and will send you the message ‘you have mail' prior to issuing the next command line prompt.



To read your mail, the ‘mail' command should be entered with no argument. The most recent mail message will be displayed, followed by a prompt ‘?' . Enter ‘d' to delete the item, ‘q' to quit etc. If unsure of the available options enter ? for help.



Note: Many system utilities on UNIX use ‘mail' as an ouput media for their messages. For this reason the files in /var/mail should be checked periodically for messages and also cleared to save space.



6.2 Sending on line messages with write



The ‘write' command allows unidirectional communication with other users on line on the UNIX system. It is actioned as follows:



write username [terminal number]



It is only necessary to include the terminal number if the required user is logged on at more than one terminal and it is required to specify which terminal to send the message to.



Message from ctatrnr (ttyp1) [ Fri Nov 06 09:02:03 ] ...

don't forget to do the backup tonight!





The recipient will receive a message header, followed by the message and if the message has been terminated. If the recipient wishes to reply to the message they would also have to issue the command ‘write' followed by the username they wish to reply to.



6.3 Broadcast messages with wall



The ‘wall' command is a variant of ‘write' that allows messages to be sent to all logged on users at the same time. It is commonly used by system administrators to send system messages to everyone at the same time.



wall

The system is being taken down in 10 minutes

PLEASE LOG OFF NOW!





Note that with the ‘wall' command, none of the message is sent until the final ‘CTRL-D' is entered



Note: Both ‘write' and ‘wall' are cursor based commands and will start writing their messages across the users screen, from the current cursor position. Obviously this may be disconcerting to the recipient and care should be taken when using these utilities.



6.4 Enabling/Disabling messages



While editing files or performing other tasks, a user may prefer not to be disturbed by incoming messages being written across their terminal screen. The command ‘mesg' may be used to switch access permissions to the terminal off and on.



mesg n deny access

mesg y allow access



This will not prevent messages being received if they are sent by someone with ‘superuser' privileges.



6.5 Communicating on line with talk



This is an interactive bi-directional command, allowing two users to carry out a ‘conversation' on the system. The originator ‘usera' would type:



talk userb



The second user receives a message that usera is trying to contact them and initiates a reply with:



talk usera



Both users can then type input at the same time on the split screen provided. The links can be terminated by either user entering an interrupt.



Message from Talk_Daemon@dopey at 10:13 ...

talk: connection requested by ctatrnr@dopey.sema.co.uk.

talk: respond with: talk ctatrnr@dopey.sema.co.uk

[Waiting for your party to respond]







Note: Excessive use of this utility may affect network performance. For proper operation, terminals must be in ‘ANSI' mode.






 
Other Articles Written By This User


Copyright © 2003 - 2012 URL.biz. All rights reserved.