mesg(1)								      mesg(1)

  mesg - Permits or refuses write messages


  mesg [-][yes | no]


  The mesg command controls whether other users on the system can send mes-
  sages to you with the talk and write commands.  Called without arguments,
  mesg displays the current terminal message permission setting.  The shell
  start-up procedure disallows messages by default.  You can override this
  default action by including the line mesg y in your $HOME/.profile (sh),
  .cshrc (csh), or .login (csh) file.  This default setting for whether the
  shell start-up procedure permits messages assumes that the shell is one
  started as part of a login session.  If the shell got started by some other
  means, the default depends on what that other program has done.

  Any user can send messages with write if the receiving user has enabled
  messages.  A user with the sysadmin command authorization can send messages
  to any terminal.

  The terminal device affected is determined by searching for the first ter-
  minal in the sequence of devices associated with standard input, standard
  output, and standard error, respectively.  (In other words, the affected
  device is not the same as the controlling terminal for the session.)

  Message permission has no effect on messages delivered through the elec-
  tronic mail system.

  If you add mesg y to your $HOME/.profile, you will be able to receive mes-
  sages from other users via the write command or the talk command.  If you
  add mesg n to your $HOME/.profile, you will not be able to receive messages
  from other users via the write command or the talk command.


      Disables incoming write messages, except by appropriately authorized
      users.  Use this form of the command to avoid having others clutter
      your display with incoming messages.

      Permits write messages by all systems on the local network.

  The mesg command also accepts the current locale's equivalent of yes and
  no.  These equivalents are determined by the setting of the LC_MESSAGES
  environment variable.	 The usage message displays the current locale's
  equivalent of yes and no.

  Note that if your current locale define settings other than yes or no, the
  mesg command does not accept yes or no as arguments.	This causes an error
  if you use a yes or no argument to mesg in your .profile file.

  Security Restrictions

  In the trusted configuration of the system, all terminal devices have owner
  set to the login user and group set to the pseudogroup tty.  The login com-
  mand sets terminal modes to 0600 at login time, so you must explicitly use
  mesg y to enable access from unauthorized users.


   1.  To allow only appropriately authorized users to send messages to your
       terminal, enter:
	    mesg no

   2.  To allow everyone the permission to send messages to your terminal,
	    mesg yes


	     User profile.

  .cshrc     User profile (csh).

  .login     User profile (csh).


  The mesg command returns a value of 0 (zero) if receiving messages is
  allowed, and returns a value of 1 if receiving messages is not allowed.  If
  an error occurs, mesg returns a value of 2.


  Commands:  talk(1), wall(1), write(1).

  Functions:  rpmatch(3).