get the terminal's name
tty [ -l ] [ -s ]
The tty command prints the pathname of the user's terminal
on the standard output. The -s option inhibits printing
of the terminal name, allowing you to test just the exit code.
The -l option tests whether the terminal line is an active
synchronous line. An additional message is printed to indicate the
status of the line (see ``Diagnostics'').
The following exit values are returned:
the standard input is a terminal
the standard input is not a terminal
an error occurred
not a tty
the standard input is not a terminal (-s not specified)
not on an active synchronous line
the standard input is not an active synchronous line (-l
synchronous line n
the standard input is active synchronous line number n
tty is conformant with:
ISO/IEC DIS 99452:1992, Information technology Portable Operating System Interface (POSIX) Part 2: Shell and Utilities (IEEE Std 1003.21992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005