Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/utilities/t/tty.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/utilities/t/tty.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/utilities/t/tty.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/utilities/t/tty.html on line 8

tty

Return the user's terminal name (POSIX)

Syntax:

tty [-s]

Runs on:

Neutrino

Options:

-s
Be silent; don't output the terminal name. This option is useful if you're concerned only with tty's exit status.

Description:

The tty utility writes to the standard output the name of the terminal that's open as standard input. If standard input isn't a terminal (e.g. it's a file such as /dev/null), the string not a tty is output instead.


Note: The -s option is deprecated by POSIX; you can achieve the effect of this option, simply and portably, by redirecting output to /dev/null or by using the shell builtin, test -c.

Examples:

The following command prints /dev/con1 if run on console 1:

tty

The following command prints not a tty because /dev/null causes isatty() to return 0:

tty </dev/null

Exit status:

0
Success.
> 0
An error occurred.

Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/utilities/t/tty.html on line 129

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/utilities/t/tty.html on line 129