logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

tty.1p (4603B)


  1. '\" et
  2. .TH TTY "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. tty
  12. \(em return user's terminal name
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. tty
  17. .fi
  18. .SH DESCRIPTION
  19. The
  20. .IR tty
  21. utility shall write to the standard output the name of the terminal
  22. that is open as standard input. The name that is used shall be
  23. equivalent to the string that would be returned by the
  24. \fIttyname\fR()
  25. function defined in the System Interfaces volume of POSIX.1\(hy2017.
  26. .SH OPTIONS
  27. The
  28. .IR tty
  29. utility shall conform to the Base Definitions volume of POSIX.1\(hy2017,
  30. .IR "Section 12.2" ", " "Utility Syntax Guidelines".
  31. .SH OPERANDS
  32. None.
  33. .SH STDIN
  34. While no input is read from standard input, standard input shall be
  35. examined to determine whether or not it is a terminal, and, if so, to
  36. determine the name of the terminal.
  37. .SH "INPUT FILES"
  38. None.
  39. .SH "ENVIRONMENT VARIABLES"
  40. The following environment variables shall affect the execution of
  41. .IR tty :
  42. .IP "\fILANG\fP" 10
  43. Provide a default value for the internationalization variables that are
  44. unset or null. (See the Base Definitions volume of POSIX.1\(hy2017,
  45. .IR "Section 8.2" ", " "Internationalization Variables"
  46. for the precedence of internationalization variables used to determine
  47. the values of locale categories.)
  48. .IP "\fILC_ALL\fP" 10
  49. If set to a non-empty string value, override the values of all the
  50. other internationalization variables.
  51. .IP "\fILC_CTYPE\fP" 10
  52. Determine the locale for the interpretation of sequences of bytes of
  53. text data as characters (for example, single-byte as opposed to
  54. multi-byte characters in arguments).
  55. .IP "\fILC_MESSAGES\fP" 10
  56. .br
  57. Determine the locale that should be used to affect the format and
  58. contents of diagnostic messages written to standard error and
  59. informative messages written to standard output.
  60. .IP "\fINLSPATH\fP" 10
  61. Determine the location of message catalogs for the processing of
  62. .IR LC_MESSAGES .
  63. .SH "ASYNCHRONOUS EVENTS"
  64. Default.
  65. .SH STDOUT
  66. If standard input is a terminal device, a pathname of the terminal as
  67. specified by the
  68. \fIttyname\fR()
  69. function defined in the System Interfaces volume of POSIX.1\(hy2017 shall be written in the following
  70. format:
  71. .sp
  72. .RS 4
  73. .nf
  74. "%s\en", <\fIterminal name\fR>
  75. .fi
  76. .P
  77. .RE
  78. .P
  79. Otherwise, a message shall be written indicating that standard input is
  80. not connected to a terminal. In the POSIX locale, the
  81. .IR tty
  82. utility shall use the format:
  83. .sp
  84. .RS 4
  85. .nf
  86. "not a tty\en"
  87. .fi
  88. .P
  89. .RE
  90. .SH STDERR
  91. The standard error shall be used only for diagnostic messages.
  92. .SH "OUTPUT FILES"
  93. None.
  94. .SH "EXTENDED DESCRIPTION"
  95. None.
  96. .SH "EXIT STATUS"
  97. The following exit values shall be returned:
  98. .IP "\00" 6
  99. Standard input is a terminal.
  100. .IP "\01" 6
  101. Standard input is not a terminal.
  102. .IP >1 6
  103. An error occurred.
  104. .SH "CONSEQUENCES OF ERRORS"
  105. Default.
  106. .LP
  107. .IR "The following sections are informative."
  108. .SH "APPLICATION USAGE"
  109. This utility checks the status of the file open as standard input
  110. against that of an implementation-defined set of files. It is possible
  111. that no match can be found, or that the match found need not be the
  112. same file as that which was opened for standard input (although they
  113. are the same device).
  114. .SH EXAMPLES
  115. None.
  116. .SH RATIONALE
  117. None.
  118. .SH "FUTURE DIRECTIONS"
  119. None.
  120. .SH "SEE ALSO"
  121. The Base Definitions volume of POSIX.1\(hy2017,
  122. .IR "Chapter 8" ", " "Environment Variables",
  123. .IR "Section 12.2" ", " "Utility Syntax Guidelines"
  124. .P
  125. The System Interfaces volume of POSIX.1\(hy2017,
  126. .IR "\fIisatty\fR\^(\|)",
  127. .IR "\fIttyname\fR\^(\|)"
  128. .\"
  129. .SH COPYRIGHT
  130. Portions of this text are reprinted and reproduced in electronic form
  131. from IEEE Std 1003.1-2017, Standard for Information Technology
  132. -- Portable Operating System Interface (POSIX), The Open Group Base
  133. Specifications Issue 7, 2018 Edition,
  134. Copyright (C) 2018 by the Institute of
  135. Electrical and Electronics Engineers, Inc and The Open Group.
  136. In the event of any discrepancy between this version and the original IEEE and
  137. The Open Group Standard, the original IEEE and The Open Group Standard
  138. is the referee document. The original Standard can be obtained online at
  139. http://www.opengroup.org/unix/online.html .
  140. .PP
  141. Any typographical or formatting errors that appear
  142. in this page are most likely
  143. to have been introduced during the conversion of the source files to
  144. man page format. To report such errors, see
  145. https://www.kernel.org/doc/man-pages/reporting_bugs.html .