MSG(1)

NAME
msg - write a short message to other users

SYNOPSIS
msg [ -l ] [ -m message ] [ -p ] [ -r ] [ -t ] user ...

DESCRIPTION
Msg writes a one-line message to a given set of users. If a user is logged in more than once, each instance of that user will receive the message.

Previous versions of msg allowed the last argument to be the message. This confusing behaviour is no longer available.

The message is preceded by a beep, the login name of the sender, and the name of the sender's machine. If the sender is set-userid to someone other than the super-user, then the real (set-userid) name is printed in parentheses. Replies should use the login name, not the parenthesized (set-userid) name, since the login name is the way msg finds people.

Msg works across machines, as long as the remote machine is running the msgd(8) message daemon. To do this, user should be of the form person@machine (or the old-style machine!person ).

It is very annoying to receive a message just before your screen clears, making it impossible to read the message. To help alleviate this problem, msg will save a copy of the message and you can use the -l option to repeat the last message you received.

It is also annoying to discover a message on your screen but not know when it was sent. Use -t to find out.

OPTIONS

-r  If the -r, option is given, msg will look in the file /usr/tmp/msg.userid file to find out the last person who sent you a message, and assume you want to reply to them. (Additional recipients can still be specified, so the same rules apply about which arguments are messages and which are users. The easiest thing to use is msg -r with no other arguments; type the reply on the next line.)

-l  List the last message received. This simply shows the file /usr/tmp/msg.userid so that you don't have to remember the name. msg -lr is a handy way to show the last message and prompt for a reply.

-t  Show the time that the last message was received. Handy combinations are -tl and -tlr.

-p  Use the text of the previous message you sent (saved in the file /usr/tmp/pmsg.userid) as the text of this message. This is handy if you mistyped someone's userid, and typed a long message only to have it fail.

Msg obeys the restrictions of mesg(1).

SEE ALSO
write(1), mail(1), talk(1), msgd(8)

EXAMPLES

% msg -m 'This is the message in quotes.' user1 user2
    Quoting a string makes it one argument as far as Unix is concerned.

% msg user1 user2
    <type the message here, on the next line>

% msg -r
    <Type a reply here to the last person who sent you a msg.>

% msg -r -m 'Or you can put the reply here.'

FILES

/usr/tmp/msg.userid
    Contains the last message received.

/usr/tmp/pmsg.userid
    Contains the text of the previous message sent or attempted.

/usr/tmp/mesg.userid
    Answerback message - set by mesg(1).

AUTHOR
The staff of the Math Faculty Computing Facility at the University of Waterloo, Waterloo, Ontario Canada. Bug reports can be sent to either or both of John Sellens (jmsellens@watmath.waterloo.edu) or uw.mfcf.bugs@watmath.waterloo.edu.

COPYRIGHT
Copyright 1988, 1989, 1990 University of Waterloo
Redistribution is permitted.