6

I found the following in man who:

-T, -w, --mesg add user's message status as +, - or ?
--message same as -T
--writablesame as -T

So looked up info who and found

-w -T --mesg --message --writable After each login name print a character indicating the user's message status
+ allowing 'write' messages
- disallowing 'write' messages
? 'cannot find terminal device'

Question: What 'message', which kind of 'message' is meant?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
erch
  • 4,890
  • 17
  • 49
  • 81

1 Answers1

7

The -T and --message switch mean that who will display a +, -, or ? denoting whether the user is allowing messages to be written to their terminal.

`--writable'
     After each login name print a character indicating the user's
     message status:

          `+' allowing `write' messages
          `-' disallowing `write' messages
          `?' cannot find terminal device

Example

$ who --message
saml     - tty1         2013-11-03 16:09 (:0)
saml     + pts/0        2013-11-03 16:10 (:0.0)
saml     + pts/1        2013-11-03 16:49 (:0.0)
saml     + pts/6        2013-11-04 12:28 (:0.0)
saml     + pts/20       2013-11-05 13:16 (:0.0)
saml     + pts/43       2013-11-05 16:58 (:0.0)

The -T switch does the same thing.

What are messages?

Messages is a facility in Unix where people can write messages directly into someone else's terminal device.

Example

$ write 
usage: write user [tty]

saml on tty1 has his message receive capability disabled (-).

$ write saml tty1
write: saml has messages disabled on tty1

However user saml is allowing messages on pts/0:

$ write saml pts/0
hola

If I switch over to the tab that corresponds to pts/0:

[saml@grinchy ~]$ 
Message from saml@grinchy on pts/43 at 17:06 ...
hola

Enabling/Disabling the status

You can use the command mesg to enable and disable this feature in a given terminal.

Messages is enabled.

$ who --message | grep "pts/0"
saml     + pts/0        2013-11-03 16:10 (:0.0)

Turn it off.

$ mesg n

Now it's disabled.

$ who --message | grep "pts/0"
saml     - pts/0        2013-11-03 16:10 (:0.0)
slm
  • 363,520
  • 117
  • 767
  • 871
  • `mesg` and `write` put a bee in the bonnet here :) an awsome answer with unexpected results… – erch Nov 07 '13 at 00:19
  • @chirp - ha! I would consider it a legit question. No bees here IMO. It's always good to push your own and therefore everyone else's understanding of the world around oneself. – slm Nov 07 '13 at 01:12
  • this was meant as a compliment – erch Nov 08 '13 at 14:43
  • 1
    @chirp - OK, sorry I wasn't fully groking what you meant. Yes there is one thing that you can consistently count on with Linux/Unix/Opensource is a limitless supply of things to waste your time, in a good way! I read your other comment about the face plant and this one and thought it the other way 8-) – slm Nov 08 '13 at 14:49