TTY(1) User Commands TTY(1)

tty - get terminal name

tty [-l] [-s]

Tty prints the pathname of the user's terminal. If the -s option is present, nothing is printed, and only the exit status is affected. With the -l option, tty prints the line number if standard input is connected to a synchronous line.

`not a tty' if the standard input file is not a terminal.

The exit status is

0
if standard input is a terminal;
1
if standard input is not a terminal;
2
or greater on error.
5/21/03 Heirloom Toolchest