tty(C)


tty -- get the terminal's name

Syntax

tty [ -l ] [ -s ]

Description

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'').

Exit values

The following exit values are returned:

0
the standard input is a terminal

1
the standard input is not a terminal

>1
an error occurred

Diagnostics


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 specified)

synchronous line n
the standard input is active synchronous line number n (-l specified)

Standards conformance

tty is conformant with:

ISO/IEC DIS 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
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