February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Returns the pathname of the terminal device.
Syntax
tty [-s]
Options
-s suppresses reporting the pathname. (It might be useful to check for the existence of a terminal device.)
Oddities
It can be used to determine whether the standard input is a terminal.
Example
$ tty # Current terminal device /dev/pts/0 $ $ tty –s # If successful, stdin is a tty $ print $? 0 $
Read now
Unlock full access