TTY(1) — UNIX Programmer’s Manual
NAME
tty − get terminal name
SYNOPSIS
tty [ −s ]
DESCRIPTION
Tty prints the pathname of the user’s terminal unless the −s (silent) option is given. In either case, the exit value is zero if the standard input is a terminal and one if it is not.
EXIT STATUS
0 Standard input is a terminal.
1 Standard input is not a terminal.
2 Invalid options were given.
DIAGNOSTICS
The diagnostic “not a tty” is printed if the standard input file is not a terminal and −s is not given. A usage message is output if invalid options are given.
System V — Revision 1.3 of 15/10/90