Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
write.html (13117B)
1 <!-- Copyright 2001-2024 IEEE and The Open Group, All Rights Reserved --> 2 <!DOCTYPE HTML> 3 <html lang="en"> 4 <head> 5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0"> 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 7 <link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group rhtm tool v1.2.4 --> 8 <!-- Copyright (c) 2001-2024 The Open Group, All Rights Reserved --> 9 <title>write</title> 10 </head> 11 <body bgcolor="white"> 12 <div class="NAVHEADER"> 13 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 14 <tr class="nav"> 15 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/who.html" accesskey="P"><<< 16 Previous</a></td> 17 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 18 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/xargs.html" accesskey="N">Next 19 >>></a></td> 20 </tr> 21 </table> 22 <hr align="left" width="100%"></div> 23 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> 24 <center><font size="2">The Open Group Base Specifications Issue 8<br> 25 IEEE Std 1003.1-2024<br> 26 Copyright © 2001-2024 The IEEE and The Open Group</font></center> 27 <hr size="2" noshade> 28 <a name="top" id="top"></a> <a name="write" id="write"></a> <a name="tag_20_151" id="tag_20_151"></a><!-- write --> 29 <h4 class="mansect"><a name="tag_20_151_01" id="tag_20_151_01"></a>NAME</h4> 30 <blockquote>write — write to another user</blockquote> 31 <h4 class="mansect"><a name="tag_20_151_02" id="tag_20_151_02"></a>SYNOPSIS</h4> 32 <blockquote class="synopsis"> 33 <p><code><tt>write</tt> <i>user_name</i> <b>[</b><i>terminal</i><b>]</b></code></p> 34 </blockquote> 35 <h4 class="mansect"><a name="tag_20_151_03" id="tag_20_151_03"></a>DESCRIPTION</h4> 36 <blockquote> 37 <p>The <i>write</i> utility shall read lines from the standard input and write them to the terminal of the specified user. When 38 first invoked, it shall write the message:</p> 39 <pre> 40 <b>Message from </b><i>sender-login-id</i><tt> (</tt><i>sending-terminal</i><tt>) </tt><b>[</b><i>date</i><b>]</b><tt>... 41 </tt></pre> 42 <p>to <i>user_name</i>. When it has successfully completed the connection, the sender's terminal shall be alerted twice to indicate 43 that what the sender is typing is being written to the recipient's terminal.</p> 44 <p>If the recipient wants to reply, this can be accomplished by typing:</p> 45 <pre> 46 <tt>write </tt><i>sender-login-id </i><b>[</b><i>sending-terminal</i><b>]</b><tt> 47 </tt></pre> 48 <p>upon receipt of the initial message. Whenever a line of input as delimited by an NL, EOF, or EOL special character (see XBD 49 <a href="../basedefs/V1_chap11.html#tag_11"><i>11. General Terminal Interface</i></a> ) is accumulated while in canonical input 50 mode, the accumulated data shall be written on the other user's terminal. Characters shall be processed as follows:</p> 51 <ul> 52 <li> 53 <p>Typing <alert> shall write the <alert> character to the recipient's terminal.</p> 54 </li> 55 <li> 56 <p>Typing the erase and kill characters shall affect the sender's terminal in the manner described by the <b>termios</b> interface 57 in XBD <a href="../basedefs/V1_chap11.html#tag_11"><i>11. General Terminal Interface</i></a> .</p> 58 </li> 59 <li> 60 <p>Typing the interrupt or end-of-file characters shall cause <i>write</i> to write an appropriate message (<tt>"EOT\n"</tt> in the 61 POSIX locale) to the recipient's terminal and exit.</p> 62 </li> 63 <li> 64 <p>Typing characters from <i>LC_CTYPE</i> classifications <b>print</b> or <b>space</b> shall cause those characters to be sent to 65 the recipient's terminal.</p> 66 </li> 67 <li> 68 <p>When and only when the <a href="../utilities/stty.html"><i>stty</i></a> <b>iexten</b> local mode is enabled, the existence and 69 processing of additional special control characters and multi-byte or single-byte functions is implementation-defined.</p> 70 </li> 71 <li> 72 <p>Typing other non-printable characters shall cause implementation-defined sequences of printable characters to be written to the 73 recipient's terminal.</p> 74 </li> 75 </ul> 76 <p>To write to a user who is logged in more than once, the <i>terminal</i> argument can be used to indicate which terminal to write 77 to; otherwise, the recipient's terminal is selected in an implementation-defined manner and an informational message is written to 78 the sender's standard output, indicating which terminal was chosen.</p> 79 <p>Permission to be a recipient of a <i>write</i> message can be denied or granted by use of the <a href= 80 "../utilities/mesg.html"><i>mesg</i></a> utility. However, a user's privilege may further constrain the domain of accessibility of 81 other users' terminals. The <i>write</i> utility shall fail when the user lacks appropriate privileges to perform the requested 82 action.</p> 83 </blockquote> 84 <h4 class="mansect"><a name="tag_20_151_04" id="tag_20_151_04"></a>OPTIONS</h4> 85 <blockquote> 86 <p>None.</p> 87 </blockquote> 88 <h4 class="mansect"><a name="tag_20_151_05" id="tag_20_151_05"></a>OPERANDS</h4> 89 <blockquote> 90 <p><br> 91 The following operands shall be supported:</p> 92 <dl compact> 93 <dd></dd> 94 <dt><i>user_name</i></dt> 95 <dd>Login name of the person to whom the message shall be written. The application shall ensure that this operand is of the form 96 returned by the <a href="../utilities/who.html"><i>who</i></a> utility.</dd> 97 <dt><i>terminal</i></dt> 98 <dd>Terminal identification in the same format provided by the <a href="../utilities/who.html"><i>who</i></a> utility.</dd> 99 </dl> 100 </blockquote> 101 <h4 class="mansect"><a name="tag_20_151_06" id="tag_20_151_06"></a>STDIN</h4> 102 <blockquote> 103 <p>Lines to be copied to the recipient's terminal are read from standard input.</p> 104 </blockquote> 105 <h4 class="mansect"><a name="tag_20_151_07" id="tag_20_151_07"></a>INPUT FILES</h4> 106 <blockquote> 107 <p>None.</p> 108 </blockquote> 109 <h4 class="mansect"><a name="tag_20_151_08" id="tag_20_151_08"></a>ENVIRONMENT VARIABLES</h4> 110 <blockquote> 111 <p>The following environment variables shall affect the execution of <i>write</i>:</p> 112 <dl compact> 113 <dd></dd> 114 <dt><i>LANG</i></dt> 115 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 116 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 117 variables used to determine the values of locale categories.)</dd> 118 <dt><i>LC_ALL</i></dt> 119 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 120 <dt><i>LC_CTYPE</i></dt> 121 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 122 opposed to multi-byte characters in arguments and input files). If the recipient's locale does not use an <i>LC_CTYPE</i> 123 equivalent to the sender's, the results are undefined.</dd> 124 <dt><i>LC_MESSAGES</i></dt> 125 <dd><br> 126 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error and 127 informative messages written to standard output.</dd> 128 <dt><i>NLSPATH</i></dt> 129 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 130 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border= 131 "0"></dd> 132 </dl> 133 </blockquote> 134 <h4 class="mansect"><a name="tag_20_151_09" id="tag_20_151_09"></a>ASYNCHRONOUS EVENTS</h4> 135 <blockquote> 136 <p>If an interrupt signal is received, <i>write</i> shall write an appropriate message on the recipient's terminal and exit with a 137 status of zero. It shall take the standard action for all other signals.</p> 138 </blockquote> 139 <h4 class="mansect"><a name="tag_20_151_10" id="tag_20_151_10"></a>STDOUT</h4> 140 <blockquote> 141 <p>An informational message shall be written to standard output if a recipient is logged in more than once.</p> 142 </blockquote> 143 <h4 class="mansect"><a name="tag_20_151_11" id="tag_20_151_11"></a>STDERR</h4> 144 <blockquote> 145 <p>The standard error shall be used only for diagnostic messages.</p> 146 </blockquote> 147 <h4 class="mansect"><a name="tag_20_151_12" id="tag_20_151_12"></a>OUTPUT FILES</h4> 148 <blockquote> 149 <p>The recipient's terminal is used for output.</p> 150 </blockquote> 151 <h4 class="mansect"><a name="tag_20_151_13" id="tag_20_151_13"></a>EXTENDED DESCRIPTION</h4> 152 <blockquote> 153 <p>None.</p> 154 </blockquote> 155 <h4 class="mansect"><a name="tag_20_151_14" id="tag_20_151_14"></a>EXIT STATUS</h4> 156 <blockquote> 157 <p>The following exit values shall be returned:</p> 158 <dl compact> 159 <dd></dd> 160 <dt> 0</dt> 161 <dd>Successful completion.</dd> 162 <dt>>0</dt> 163 <dd>The addressed user is not logged on or the addressed user denies permission.</dd> 164 </dl> 165 </blockquote> 166 <h4 class="mansect"><a name="tag_20_151_15" id="tag_20_151_15"></a>CONSEQUENCES OF ERRORS</h4> 167 <blockquote> 168 <p>Default.</p> 169 </blockquote> 170 <hr> 171 <div class="box"><em>The following sections are informative.</em></div> 172 <h4 class="mansect"><a name="tag_20_151_16" id="tag_20_151_16"></a>APPLICATION USAGE</h4> 173 <blockquote> 174 <p>The <a href="../utilities/talk.html"><i>talk</i></a> utility is considered by some users to be a more usable utility on 175 full-screen terminals.</p> 176 </blockquote> 177 <h4 class="mansect"><a name="tag_20_151_17" id="tag_20_151_17"></a>EXAMPLES</h4> 178 <blockquote> 179 <p>None.</p> 180 </blockquote> 181 <h4 class="mansect"><a name="tag_20_151_18" id="tag_20_151_18"></a>RATIONALE</h4> 182 <blockquote> 183 <p>The <i>write</i> utility was included in this volume of POSIX.1-2024 since it can be implemented on all terminal types. The 184 standard developers considered the <a href="../utilities/talk.html"><i>talk</i></a> utility, which cannot be implemented on certain 185 terminals, to be a "better" communications interface. Both of these programs are in widespread use on historical implementations. 186 Therefore, the standard developers decided that both utilities should be specified.</p> 187 <p>The format of the terminal name is unspecified, but the descriptions of <a href="../utilities/ps.html"><i>ps</i></a>, <a href= 188 "../utilities/talk.html"><i>talk</i></a>, <a href="../utilities/who.html"><i>who</i></a>, and <i>write</i> require that they all 189 use or accept the same format.</p> 190 </blockquote> 191 <h4 class="mansect"><a name="tag_20_151_19" id="tag_20_151_19"></a>FUTURE DIRECTIONS</h4> 192 <blockquote> 193 <p>None.</p> 194 </blockquote> 195 <h4 class="mansect"><a name="tag_20_151_20" id="tag_20_151_20"></a>SEE ALSO</h4> 196 <blockquote> 197 <p><a href="../utilities/mesg.html#"><i>mesg</i></a> , <a href="../utilities/talk.html#"><i>talk</i></a> , <a href= 198 "../utilities/who.html#"><i>who</i></a></p> 199 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href= 200 "../basedefs/V1_chap11.html#tag_11"><i>11. General Terminal Interface</i></a></p> 201 </blockquote> 202 <h4 class="mansect"><a name="tag_20_151_21" id="tag_20_151_21"></a>CHANGE HISTORY</h4> 203 <blockquote> 204 <p>First released in Issue 2.</p> 205 </blockquote> 206 <h4 class="mansect"><a name="tag_20_151_22" id="tag_20_151_22"></a>Issue 5</h4> 207 <blockquote> 208 <p>The FUTURE DIRECTIONS section is added.</p> 209 </blockquote> 210 <h4 class="mansect"><a name="tag_20_151_23" id="tag_20_151_23"></a>Issue 6</h4> 211 <blockquote> 212 <p>This utility is marked as part of the User Portability Utilities option.</p> 213 <p>The normative text is reworded to avoid use of the term "must" for application requirements.</p> 214 </blockquote> 215 <h4 class="mansect"><a name="tag_20_151_24" id="tag_20_151_24"></a>Issue 7</h4> 216 <blockquote> 217 <p>The <i>write</i> utility is moved from the User Portability Utilities option to the Base. User Portability Utilities is now an 218 option for interactive utilities.</p> 219 </blockquote> 220 <h4 class="mansect"><a name="tag_20_151_25" id="tag_20_151_25"></a>Issue 8</h4> 221 <blockquote> 222 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p> 223 </blockquote> 224 <div class="box"><em>End of informative text.</em></div> 225 <hr> 226 <p> </p> 227 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 228 <hr size="2" noshade> 229 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 230 POSIX™ is a Trademark of The IEEE.<br> 231 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 232 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 233 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 234 ]</font></center> 235 <hr size="2" noshade> 236 <div class="NAVHEADER"> 237 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 238 <tr class="nav"> 239 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/who.html" accesskey="P"><<< 240 Previous</a></td> 241 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 242 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/xargs.html" accesskey="N">Next 243 >>></a></td> 244 </tr> 245 </table> 246 <hr align="left" width="100%"></div> 247 </body> 248 </html>