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) is given. In either case, the exit value is zero if the standard input is a terminal and one if it is not.
DIAGNOSTICS
‘not a tty’ if the standard input file is not a terminal.
7th Edition — April 29, 1985