tty(1)
NAME
tty − get the name of the terminal
SYNOPSIS
tty [ −l ] [ −s ]
AVAILABILITY
SUNWcsu
DESCRIPTION
tty prints the path name of the user’s terminal.
OPTIONS
−l Prints the synchronous line number to which the user’s terminal is connected, if it is on an active synchronous line.
−s Inhibits printing of the terminal path name, allowing one to test just the exit code.
EXIT CODES
2if invalid options were specified,
0if standard input is a terminal,
1otherwise.
ENVIRONMENT
If any of the LC_∗ variables ( LC_CTYPE, LC_MESSAGES, LC_TIME, LC_COLLATE, LC_NUMERIC, and LC_MONETARY ) (see environ(5)) are not set in the environment, the operational behavior of tty for each corresponding locale category is determined by the value of the LANG environment variable. If LC_ALL is set, its contents are used to override both the LANG and the other LC_∗ variables. If none of the above variables is set in the environment, the "C" (U.S. style) locale determines how tty behaves.
LC_CTYPE
Determines how tty handles characters. When LC_CTYPE is set to a valid value, tty can display and handle text and filenames containing valid characters for that locale. tty can display and handle Extended Unix Code (EUC) characters where any individual character can be 1, 2, or 3 bytes wide. tty can also handle EUC characters of 1, 2, or more column widths. In the "C" locale, only characters from ISO 8859-1 are valid.
LC_MESSAGES
Determines how diagnostic and informative messages are presented. This includes the language and style of the messages, and the correct form of affirmative and negative responses. In the "C" locale, the messages are presented in the default form found in the program itself (in most cases, U.S. English).
SEE ALSO
DIAGNOSTICS
“not on an active synchronous line“
The standard input is not a synchronous terminal and −l is specified.
“not a tty” The standard input is not a terminal and −s is not specified.
SunOS 5.4 — Last change: 26 Sep 1992