📄 talk.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2004 IEEE and The Open Group, All Rights Reserved --><title>talk</title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="talk"></a> <a name="tag_04_138"></a><!-- talk --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2004 Edition<br>Copyright © 2001-2004 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_04_138_01"></a>NAME</h4><blockquote>talk - talk to another user</blockquote><h4><a name="tag_04_138_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><div class="box"><code><tt><sup>[<a href="javascript:open_code('UP')">UP</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> talk</tt> <i>address</i> <b>[</b><i>terminal</i><b>]</b><tt><img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div></blockquote><h4><a name="tag_04_138_03"></a>DESCRIPTION</h4><blockquote><p>The <i>talk</i> utility is a two-way, screen-oriented communication program.</p><p>When first invoked, <i>talk</i> shall send a message similar to:</p><pre><tt>Message from <</tt><i>unspecified string</i><tt>>talk: connection requested by</tt> <i>your_address</i><tt>talk: respond with: talk</tt> <i>your_address</i></pre><p>to the specified <i>address</i>. At this point, the recipient of the message can reply by typing:</p><pre><tt>talk</tt> <i>your_address</i></pre><p>Once communication is established, the two parties can type simultaneously, with their output displayed in separate regions ofthe screen. Characters shall be processed as follows:</p><ul><li><p>Typing the alert character shall alert the recipient's terminal.</p></li><li><p>Typing <control>-L shall cause the sender's screen regions to be refreshed.</p></li><li><p>Typing the erase and kill characters shall affect the sender's terminal in the manner described by the <b>termios</b> interfacein the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap11.html#tag_11">Chapter 11, GeneralTerminal Interface</a>.</p></li><li><p>Typing the interrupt or end-of-file characters shall terminate the local <i>talk</i> utility. Once the <i>talk</i> session hasbeen terminated on one side, the other side of the <i>talk</i> session shall be notified that the <i>talk</i> session has beenterminated and shall be able to do nothing except exit.</p></li><li><p>Typing characters from <i>LC_CTYPE</i> classifications <b>print</b> or <b>space</b> shall cause those characters to be sent tothe recipient's terminal.</p></li><li><p>When and only when the <a href="../utilities/stty.html"><i>stty</i></a> <b>iexten</b> local mode is enabled, the existence andprocessing of additional special control characters and multi-byte or single-byte functions shall be implementation-defined.</p></li><li><p>Typing other non-printable characters shall cause implementation-defined sequences of printable characters to be sent to therecipient's terminal.</p></li></ul><p>Permission to be a recipient of a <i>talk</i> message can be denied or granted by use of the <a href="../utilities/mesg.html"><i>mesg</i></a> utility. However, a user's privilege may further constrain the domain of accessibility ofother users' terminals. The <i>talk</i> utility shall fail when the user lacks the appropriate privileges to perform the requestedaction.</p><p>Certain block-mode terminals do not have all the capabilities necessary to support the simultaneous exchange of messagesrequired for <i>talk</i>. When this type of exchange cannot be supported on such terminals, the implementation may support anexchange with reduced levels of simultaneous interaction or it may report an error describing the terminal-related deficiency.</p></blockquote><h4><a name="tag_04_138_04"></a>OPTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_138_05"></a>OPERANDS</h4><blockquote><p>The following operands shall be supported:</p><dl compact><dt><i>address</i></dt><dd>The recipient of the <i>talk</i> session. One form of <i>address</i> is the <<i>user name</i>>, as returned by the<a href="../utilities/who.html"><i>who</i></a> utility. Other address formats and how they are handled are unspecified.</dd><dt><i>terminal</i></dt><dd>If the recipient is logged in more than once, the <i>terminal</i> argument can be used to indicate the appropriate terminalname. If <i>terminal</i> is not specified, the <i>talk</i> message shall be displayed on one or more accessible terminals in use bythe recipient. The format of <i>terminal</i> shall be the same as that returned by the <a href="../utilities/who.html"><i>who</i></a> utility.</dd></dl></blockquote><h4><a name="tag_04_138_06"></a>STDIN</h4><blockquote><p>Characters read from standard input shall be copied to the recipient's terminal in an unspecified manner. If standard input isnot a terminal, talk shall write a diagnostic message and exit with a non-zero status.</p></blockquote><h4><a name="tag_04_138_07"></a>INPUT FILES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_138_08"></a>ENVIRONMENT VARIABLES</h4><blockquote><p>The following environment variables shall affect the execution of <i>talk</i>:</p><dl compact><dt><i>LANG</i></dt><dd>Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume ofIEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap08.html#tag_08_02">Section 8.2, Internationalization Variables</a> forthe precedence of internationalization variables used to determine the values of locale categories.)</dd><dt><i>LC_ALL</i></dt><dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd><dt><i>LC_CTYPE</i></dt><dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte asopposed to multi-byte characters in arguments and input files). If the recipient's locale does not use an <i>LC_CTYPE</i>equivalent to the sender's, the results are undefined.</dd><dt><i>LC_MESSAGES</i></dt><dd>Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error andinformative messages written to standard output.</dd><dt><i>NLSPATH</i></dt><dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Determine the location of message catalogs for the processing of <i>LC_MESSAGES .</i> <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt><i>TERM</i></dt><dd>Determine the name of the invoker's terminal type. If this variable is unset or null, an unspecified default terminal typeshall be used.</dd></dl></blockquote><h4><a name="tag_04_138_09"></a>ASYNCHRONOUS EVENTS</h4><blockquote><p>When the <i>talk</i> utility receives a SIGINT signal, the utility shall terminate and exit with a zero status. It shall takethe standard action for all other signals.</p></blockquote><h4><a name="tag_04_138_10"></a>STDOUT</h4><blockquote><p>If standard output is a terminal, characters copied from the recipient's standard input may be written to standard output.Standard output also may be used for diagnostic messages. If standard output is not a terminal, <i>talk</i> shall exit with anon-zero status.</p></blockquote><h4><a name="tag_04_138_11"></a>STDERR</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_138_12"></a>OUTPUT FILES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_138_13"></a>EXTENDED DESCRIPTION</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_138_14"></a>EXIT STATUS</h4><blockquote><p>The following exit values shall be returned:</p><dl compact><dt> 0</dt><dd>Successful completion.</dd><dt>>0</dt><dd>An error occurred or <i>talk</i> was invoked on a terminal incapable of supporting it.</dd></dl></blockquote><h4><a name="tag_04_138_15"></a>CONSEQUENCES OF ERRORS</h4><blockquote><p>Default.</p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_04_138_16"></a>APPLICATION USAGE</h4><blockquote><p>Because the handling of non-printable, non- <space>s is tied to the <a href="../utilities/stty.html"><i>stty</i></a>description of <b>iexten</b>, implementation extensions within the terminal driver can be accessed. For example, someimplementations provide line editing functions with certain control character sequences.</p></blockquote><h4><a name="tag_04_138_17"></a>EXAMPLES</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_138_18"></a>RATIONALE</h4><blockquote><p>The <a href="../utilities/write.html"><i>write</i></a> utility was included in this volume of IEEE Std 1003.1-2001since it can be implemented on all terminal types. The <i>talk</i> utility, which cannot be implemented on certain terminals, wasconsidered to be a "better" communications interface. Both of these programs are in widespread use on historical implementations.Therefore, both utilities have been specified.</p><p>All references to networking abilities (<i>talk</i>ing to a user on another system) were removed as being outside the scope ofthis volume of IEEE Std 1003.1-2001.</p><p>Historical BSD and System V versions of <i>talk</i> terminate both of the conversations when either user breaks out of thesession. This can lead to adverse consequences if a user unwittingly continues to enter text that is interpreted by the shell whenthe other terminates the session. Therefore, the version of <i>talk</i> specified by this volume of IEEE Std 1003.1-2001requires both users to terminate their end of the session explicitly.</p><p>Only messages sent to the terminal of the invoking user can be internationalized in any way:</p><ul><li><p>The original "Message from <<i>unspecified string</i>> ..." message sent to the terminal of the recipient cannot beinternationalized because the environment of the recipient is as yet inaccessible to the <i>talk</i> utility. The environment ofthe invoking party is irrelevant.</p></li><li><p>Subsequent communication between the two parties cannot be internationalized because the two parties may specify differentlanguages in their environment (and non-portable characters cannot be mapped from one language to another).</p></li><li><p>Neither party can be required to communicate in a language other than C and/or the one specified by their environment becauseunavailable terminal hardware support (for example, fonts) may be required.</p></li></ul><p>The text in the STDOUT section reflects the usage of the verb "display" in this section; some <i>talk</i> implementationsactually use standard output to write to the terminal, but this volume of IEEE Std 1003.1-2001 does not require that tobe the case.</p><p>The format of the terminal name is unspecified, but the descriptions of <a href="../utilities/ps.html"><i>ps</i></a>,<i>talk</i>, <a href="../utilities/who.html"><i>who</i></a>, and <a href="../utilities/write.html"><i>write</i></a> require thatthey all use or accept the same format.</p><p>The handling of non-printable characters is partially implementation-defined because the details of mapping them to printablesequences is not needed by the user. Historical implementations, for security reasons, disallow the transmission of non-printablecharacters that may send commands to the other terminal.</p></blockquote><h4><a name="tag_04_138_19"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_04_138_20"></a>SEE ALSO</h4><blockquote><p><a href="mesg.html"><i>mesg</i></a>, <a href="stty.html"><i>stty</i></a>, <a href="who.html"><i>who</i></a>, <a href="write.html"><i>write</i></a>, the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/xbd_chap11.html#tag_11">Chapter 11, General Terminal Interface</a></p></blockquote><h4><a name="tag_04_138_21"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 4.</p></blockquote><h4><a name="tag_04_138_22"></a>Issue 6</h4><blockquote><p>This utility is marked as part of the User Portability Utilities option.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -