'\" te .\" Copyright 1989 AT&T Copyright (c) 1992, X/Open Company Limited All Rights Reserved Portions Copyright (c) 1995, Sun Microsystems, Inc. All Rights Reserved .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation.Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation.In the following statement, the phrase"this text" refers to portions of the system documentation.Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group.In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard,the original IEEE and The Open Group Standard is the referee document.The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.This notice shall appear on any product containing this material. .TH mesg 1 "1997 年 10 月 31 日" "SunOS 5.11" "用户命令" .SH 名称 mesg \- 允许或拒绝消息 .SH 用法概要 .LP .nf \fBmesg\fR [\fB-n\fR | \fB-y\fR | n | y] .fi .SH 描述 .sp .LP \fBmesg\fR 实用程序控制是否允许其他用户通过 \fBwrite\fR(1)、\fBtalk\fR(1) 或其他实用程序向终端设备发送消息。通过分别在与标准输入、标准输出和标准错误关联的设备序列中搜索第一个终端来确定受影响的终端设备。不带参数时,\fBmesg\fR 将报告当前状态而不更改它。具有相应特权的进程可以独立于当前状态向终端发送消息。 .SH 选项 .sp .LP 支持以下选项: .sp .ne 2 .mk .na \fB\fB-n\fR|\fBn\fR \fR .ad .RS 9n .rt 禁止其他用户向终端发送消息。请参见 \fBwrite\fR(1)。 .RE .sp .ne 2 .mk .na \fB\fB-y\fR|\fBy\fR \fR .ad .RS 9n .rt 授予其他用户向终端发送消息的权限。 .RE .SH 环境变量 .sp .LP 有关影响 \fBmesg\fR 执行的以下环境变量的说明,请参见 \fBenviron\fR(5):\fBLANG\fR、\fBLC_ALL\fR、\fBLC_CTYPE\fR、\fBLC_MESSAGES\fR 和 \fBNLSPATH\fR。 .SH 退出状态 .sp .LP 将返回以下退出值: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 6n .rt 如果消息可以接收。 .RE .sp .ne 2 .mk .na \fB\fB1\fR\fR .ad .RS 6n .rt 如果消息不可以接收。 .RE .sp .ne 2 .mk .na \fB\fB2\fR \fR .ad .RS 6n .rt 发生错误。 .RE .SH 文件 .sp .ne 2 .mk .na \fB\fB/dev/tty*\fR \fR .ad .RS 15n .rt 终端设备 .RE .sp .ne 2 .mk .na \fB\fB/dev/pts/*\fR \fR .ad .RS 15n .rt 终端设备 .RE .SH 属性 .sp .LP 有关下列属性的说明,请参见 \fBattributes\fR(5): .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . 属性类型属性值 _ 可用性system/core-os _ 接口稳定性Committed(已确定) _ 标准请参见 \fBstandards\fR(5)。 .TE .SH 另请参见 .sp .LP \fBtalk\fR(1)、\fBwrite\fR(1)、\fBattributes\fR(5)、\fBenviron\fR(5)、\fBstandards\fR(5)