'\"! tbl | mmdoc
'\"macro stdmacro
.if n .pH g1.tty @(#)tty	40.3 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} tty 1 "User Environment Utilities" "\&"
.if \nX=1 .ds x} tty 1 "User Environment Utilities"
.if \nX=2 .ds x} tty 1 "" "\&"
.if \nX=3 .ds x} tty "" "" "\&"
.TH \*(x}
.SH NAME
\f4tty\f1 \- get the name of the terminal
.SH SYNOPSIS
\f4tty\f1
[
\f4\-l\f1
]
[
\f4\-s\f1
]
.SH DESCRIPTION
\f4tty\fP
prints the path name of the user's terminal.
.TP
\f4\-l\f1
prints the synchronous line number to which the user's terminal is
connected,
if it is on an active synchronous line.
.TP
\f4\-s\f1
inhibits printing of the terminal path name,
allowing one to test just the exit code.
.PP
.TS
center;
c s
l l.
EXIT CODES
2	if invalid options were specified,
0	if standard input is a terminal,
1	otherwise.
.TE
.SH DIAGNOSTICS
\f4``not on an active synchronous line''\f1 if the standard input is not a
synchronous terminal and
\f4\-l\f1
is specified.
.br
\f4``not a tty''\f1 if the standard input is not a terminal
and
\f4\-s\f1
is not specified.
.\"	@(#)tty.1	6.2 of 9/2/83
.Ee
