isposix

Un outil pour savoir si une commande est posix - retour accueil

git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |

tty.html (9618B)


      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>tty</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/tsort.html" accesskey="P">&lt;&lt;&lt;
     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/type.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
     19 </tr>
     20 </table>
     21 <hr align="left" width="100%"></div>
     22 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3">
     23 <center><font size="2">The Open Group Base Specifications Issue 8<br>
     24 IEEE Std 1003.1-2024<br>
     25 Copyright © 2001-2024 The IEEE and The Open Group</font></center>
     26 <hr size="2" noshade>
     27 <a name="top" id="top"></a> <a name="tty" id="tty"></a> <a name="tag_20_129" id="tag_20_129"></a><!-- tty -->
     28 <h4 class="mansect"><a name="tag_20_129_01" id="tag_20_129_01"></a>NAME</h4>
     29 <blockquote>tty — return user's terminal name</blockquote>
     30 <h4 class="mansect"><a name="tag_20_129_02" id="tag_20_129_02"></a>SYNOPSIS</h4>
     31 <blockquote class="synopsis">
     32 <p><code><tt>tty</tt></code></p>
     33 </blockquote>
     34 <h4 class="mansect"><a name="tag_20_129_03" id="tag_20_129_03"></a>DESCRIPTION</h4>
     35 <blockquote>
     36 <p>The <i>tty</i> utility shall write to the standard output the name of the terminal that is open as standard input. The name that
     37 is used shall be equivalent to the string that would be returned by the <a href="../functions/ttyname.html"><i>ttyname</i>()</a>
     38 function defined in the System Interfaces volume of POSIX.1-2024.</p>
     39 </blockquote>
     40 <h4 class="mansect"><a name="tag_20_129_04" id="tag_20_129_04"></a>OPTIONS</h4>
     41 <blockquote>
     42 <p>The <i>tty</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax
     43 Guidelines</i></a> .</p>
     44 </blockquote>
     45 <h4 class="mansect"><a name="tag_20_129_05" id="tag_20_129_05"></a>OPERANDS</h4>
     46 <blockquote>
     47 <p>None.</p>
     48 </blockquote>
     49 <h4 class="mansect"><a name="tag_20_129_06" id="tag_20_129_06"></a>STDIN</h4>
     50 <blockquote>
     51 <p>While no input is read from standard input, standard input shall be examined to determine whether or not it is a terminal, and,
     52 if so, to determine the name of the terminal.</p>
     53 </blockquote>
     54 <h4 class="mansect"><a name="tag_20_129_07" id="tag_20_129_07"></a>INPUT FILES</h4>
     55 <blockquote>
     56 <p>None.</p>
     57 </blockquote>
     58 <h4 class="mansect"><a name="tag_20_129_08" id="tag_20_129_08"></a>ENVIRONMENT VARIABLES</h4>
     59 <blockquote>
     60 <p>The following environment variables shall affect the execution of <i>tty</i>:</p>
     61 <dl compact>
     62 <dd></dd>
     63 <dt><i>LANG</i></dt>
     64 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href=
     65 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization
     66 variables used to determine the values of locale categories.)</dd>
     67 <dt><i>LC_ALL</i></dt>
     68 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd>
     69 <dt><i>LC_CTYPE</i></dt>
     70 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as
     71 opposed to multi-byte characters in arguments).</dd>
     72 <dt><i>LC_MESSAGES</i></dt>
     73 <dd><br>
     74 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error and
     75 informative messages written to standard output.</dd>
     76 <dt><i>NLSPATH</i></dt>
     77 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
     78 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border=
     79 "0"></dd>
     80 </dl>
     81 </blockquote>
     82 <h4 class="mansect"><a name="tag_20_129_09" id="tag_20_129_09"></a>ASYNCHRONOUS EVENTS</h4>
     83 <blockquote>
     84 <p>Default.</p>
     85 </blockquote>
     86 <h4 class="mansect"><a name="tag_20_129_10" id="tag_20_129_10"></a>STDOUT</h4>
     87 <blockquote>
     88 <p>If standard input is a terminal device, a pathname of the terminal as specified by the <a href=
     89 "../functions/ttyname.html"><i>ttyname</i>()</a> function defined in the System Interfaces volume of POSIX.1-2024 shall be written
     90 in the following format:</p>
     91 <pre>
     92 <tt>"%s\n", &lt;</tt><i>terminal name</i><tt>&gt;
     93 </tt></pre>
     94 <p>Otherwise, a message shall be written indicating that standard input is not connected to a terminal. In the POSIX locale, the
     95 <i>tty</i> utility shall use the format:</p>
     96 <pre>
     97 <tt>"not a tty\n"
     98 </tt></pre></blockquote>
     99 <h4 class="mansect"><a name="tag_20_129_11" id="tag_20_129_11"></a>STDERR</h4>
    100 <blockquote>
    101 <p>The standard error shall be used only for diagnostic messages.</p>
    102 </blockquote>
    103 <h4 class="mansect"><a name="tag_20_129_12" id="tag_20_129_12"></a>OUTPUT FILES</h4>
    104 <blockquote>
    105 <p>None.</p>
    106 </blockquote>
    107 <h4 class="mansect"><a name="tag_20_129_13" id="tag_20_129_13"></a>EXTENDED DESCRIPTION</h4>
    108 <blockquote>
    109 <p>None.</p>
    110 </blockquote>
    111 <h4 class="mansect"><a name="tag_20_129_14" id="tag_20_129_14"></a>EXIT STATUS</h4>
    112 <blockquote>
    113 <p>The following exit values shall be returned:</p>
    114 <dl compact>
    115 <dd></dd>
    116 <dt>&nbsp;0</dt>
    117 <dd>Standard input is a terminal, and the output specified in STDOUT was successfully written to standard output.</dd>
    118 <dt>&nbsp;1</dt>
    119 <dd>Standard input is not a terminal, and the output specified in STDOUT was successfully written to standard output.</dd>
    120 <dt>&gt;1</dt>
    121 <dd>An error occurred.</dd>
    122 </dl>
    123 </blockquote>
    124 <h4 class="mansect"><a name="tag_20_129_15" id="tag_20_129_15"></a>CONSEQUENCES OF ERRORS</h4>
    125 <blockquote>
    126 <p>Default.</p>
    127 </blockquote>
    128 <hr>
    129 <div class="box"><em>The following sections are informative.</em></div>
    130 <h4 class="mansect"><a name="tag_20_129_16" id="tag_20_129_16"></a>APPLICATION USAGE</h4>
    131 <blockquote>
    132 <p>This utility checks the status of the file open as standard input against that of an implementation-defined set of files. It is
    133 possible that no match can be found, or that the match found need not be the same file as that which was opened for standard input
    134 (although they are the same device).</p>
    135 </blockquote>
    136 <h4 class="mansect"><a name="tag_20_129_17" id="tag_20_129_17"></a>EXAMPLES</h4>
    137 <blockquote>
    138 <p>None.</p>
    139 </blockquote>
    140 <h4 class="mansect"><a name="tag_20_129_18" id="tag_20_129_18"></a>RATIONALE</h4>
    141 <blockquote>
    142 <p>None.</p>
    143 </blockquote>
    144 <h4 class="mansect"><a name="tag_20_129_19" id="tag_20_129_19"></a>FUTURE DIRECTIONS</h4>
    145 <blockquote>
    146 <p>None.</p>
    147 </blockquote>
    148 <h4 class="mansect"><a name="tag_20_129_20" id="tag_20_129_20"></a>SEE ALSO</h4>
    149 <blockquote>
    150 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href=
    151 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p>
    152 <p>XSH <a href="../functions/isatty.html#"><i>isatty</i></a> , <a href="../functions/ttyname.html#"><i>ttyname</i></a></p>
    153 </blockquote>
    154 <h4 class="mansect"><a name="tag_20_129_21" id="tag_20_129_21"></a>CHANGE HISTORY</h4>
    155 <blockquote>
    156 <p>First released in Issue 2.</p>
    157 </blockquote>
    158 <h4 class="mansect"><a name="tag_20_129_22" id="tag_20_129_22"></a>Issue 5</h4>
    159 <blockquote>
    160 <p>The SYNOPSIS is changed to indicate two forms of the command, with the second form marked as obsolete. This is a clarification
    161 and does not change the functionality published in previous issues.</p>
    162 </blockquote>
    163 <h4 class="mansect"><a name="tag_20_129_23" id="tag_20_129_23"></a>Issue 6</h4>
    164 <blockquote>
    165 <p>The obsolescent <b>-s</b> option is removed.</p>
    166 </blockquote>
    167 <h4 class="mansect"><a name="tag_20_129_24" id="tag_20_129_24"></a>Issue 8</h4>
    168 <blockquote>
    169 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p>
    170 <p>Austin Group Defect 1509 is applied, changing the EXIT STATUS section.</p>
    171 </blockquote>
    172 <div class="box"><em>End of informative text.</em></div>
    173 <hr>
    174 <p>&nbsp;</p>
    175 <a href="#top"><span class="topOfPage">return to top of page</span></a><br>
    176 <hr size="2" noshade>
    177 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br>
    178 POSIX™ is a Trademark of The IEEE.<br>
    179 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br>
    180 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
    181 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a>
    182 ]</font></center>
    183 <hr size="2" noshade>
    184 <div class="NAVHEADER">
    185 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0">
    186 <tr class="nav">
    187 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/tsort.html" accesskey="P">&lt;&lt;&lt;
    188 Previous</a></td>
    189 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td>
    190 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/type.html" accesskey="N">Next &gt;&gt;&gt;</a></td>
    191 </tr>
    192 </table>
    193 <hr align="left" width="100%"></div>
    194 </body>
    195 </html>