Previous Table of Contents Next


Module 153
wall (BSD)

DESCRIPTION

The external wall command performs a write to all users currently logged on to the system. wall differs from a write in two ways. First, it reads all of its input from the standard input. Redirection or a pipe may be used. After receiving the entire input (an EOF is encountered) wall sends the message to all users. Second, it is a unidirectional utility. It does not imply a response from the recipients. It functions as a broadcasting tool instead of a bidirectional communication tool.


NOTE:  The wall command is supported on System V as an administrative command.


COMMAND FORMAT

Following is the general format of the wall command.

     wall

FURTHER DISCUSSION

The wall message precedes its message text with the following line:

     Broadcast Message from username

It is usually used by the super-user to warn all users of immediate problems. The most common warning is the system is being shutdown within 60 seconds.

The super-user can write to any user's terminal regardless of the permissions set by the mesg command.

Some common formats include:

     wall < mesgfile

- or -

     cat mesgfile | wall

DIAGNOSTICS AND BUGS

The following messages may be returned by the wall command if it encounters problems.

"Cannot send to /dev/ttyXX"
Wall could not open the user's tty for writing. Possible problems exist with the tty driver or hardware.
"Permission denied"
The person you are trying to wall has denied other users from writing to his/her terminal. This means the recipient has done a mesg -n.
"Can no longer write to user"
The recipient performed a mesg -n after you started your wall command. This denies you permission to write to the recipient's tty.

RELATED COMMANDS

Refer to the mesg command described in Module 88 and the write command described in Module 161.

RELATED FILES

The following files are used by wall:

/etc/utmp Used to locate the destination users. The ttys are also retrieved from this file.
/etc/ttyXX A tty device file is used to write to the other users.
standard input The input is read from your terminal unless redirected from a file or piped from a previous command.

The wall command is commonly used by the system administrator (super-user) to broadcast warnings to all users currently logged on to the system. It can be used by a user like yourself. This is not done often since not very many users have a need to send message to everyone on the system.

TYPICAL OPERATION

In this activity you use the wall command to broadcast a message to everyone logged onto the system. Note you're performing this at your own risk. If you have a group of hard-core, leave-me- alone type users, you may want to skip this exercise. But if you want to display a message on every user's screen, proceed. Begin at the shell prompt.

1.  Type wall and press Return.
2.  Type the following text and press Ctrl-D. When you press Ctrl-D, wall begins to send the message to each user currently logged on to the system.
     cj> wall
     This is a broadcast message of the UNIX Beginners Broadcasting
     Foundation. Please disregard this message and get back to your
     work immediately.
     Ctrl-D

Since you are logged on to the system, the message will be sent to your tty also. This provides for simple verification that the message was sent as expected.
3.  Turn to Module 88 to continue the learning sequence.


Previous Table of Contents Next