tty(1)


tty -- get the name of the terminal

Synopsis

tty [-l] [-s]

Description

tty prints the pathname of the user's terminal. It accepts the following options:

-l
Print the synchronous line number to which the user's terminal is connected, if it is on an active synchronous line.

-s
Inhibit printing of the terminal path name, allowing one to test just the exit code.

Files


/usr/lib/locale/locale/LC_MESSAGES/uxue.abi
language-specific message file (see LANG on environ(5)).

Exit codes


0
standard input is a terminal

1
standard input is not a terminal

2
invalid option

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.

References

ttyname(3C)

Notices

Application authors should avoid use of the -s option, since it may not be supported in future releases. Use test -t 0 in its place.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004