TTY(1)
NAME
tty − get the name of the terminal
SYNOPSIS
tty [ −s ]
HP-UX COMPATIBILITY
Level: HP-UX/STANDARD
Origin: System III
DESCRIPTION
Tty prints the path name of the user’s terminal. The −s option inhibits printing of the terminal path name, allowing one to test just the exit code.
RETURN VALUE
0if standard input is a terminal,
1otherwise.
2if invalid options were specified,
DIAGNOSTICS
“not a tty” if the standard input is not a terminal and −s is not specified.
Hewlett-Packard — last mod. May 11, 2021