Commit | Line | Data |
---|---|---|
8002231e KB |
1 | .\" Copyright (c) 1989 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms are permitted | |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
daacd5f0 | 16 | .\" @(#)tty.1 6.3 (Berkeley) %G% |
e1c3feb4 | 17 | .\" |
61de41e7 | 18 | .TH TTY 1 "" |
e1c3feb4 KM |
19 | .AT 3 |
20 | .SH NAME | |
8002231e | 21 | tty \- return user's terminal name |
e1c3feb4 KM |
22 | .SH SYNOPSIS |
23 | .B tty | |
ff126578 | 24 | [ -s ] |
e1c3feb4 | 25 | .SH DESCRIPTION |
8002231e KB |
26 | The |
27 | .I tty | |
28 | utility writes the name of the terminal attached to standard input | |
29 | to standard output. | |
30 | The name that is written is the string returned by | |
31 | .IR ttyname (3). | |
32 | If the standard input is not a terminal, the message ``not a tty'' | |
33 | is written. | |
34 | The options are as follows: | |
35 | .TP | |
36 | -s | |
37 | Don't write the terminal name; only the exit status is affected | |
38 | when this option is specified. | |
39 | The | |
40 | .I -s | |
41 | option is deprecated in favor of the ``test -t 0'' command. | |
42 | .PP | |
e1c3feb4 | 43 | .I Tty |
8002231e KB |
44 | exits 0 if the standard input is a terminal, 1 if the standard input is |
45 | not a terminal, and >1 if an error occurs. | |
46 | .SH SEE\ ALSO | |
47 | test(1), ttyname(3) | |
48 | .SH STANDARDS | |
49 | The | |
50 | .I tty | |
51 | function is expected to be POSIX 1003.2 compatible. |