tty-(1f) - [FUNIX:FILESYSTEM] print information about the file/terminal connected to standard input (LICENSE:PD)
Synopsis
Description
Options
Example
Reporting Bugs
See Also
Author
License
tty- [OPTION]...
Call INQUIRE(3f) and print information about the file name of the terminal connected to standard input. The results are dependent on the programming environment used, as some of the behavior is system dependent.
--help display this help and exit --version output version information and exit
The standard leaves quite a bit as system dependent. It is always interesting. For example, on CygWin using gfortran V5.4If I just type in the command at a prompt the INPUT_UNIT of 5 is returned as unit 0. But if I call the tty- from within vim(1) it is returned as 5.
tty- > for INPUT_UNIT=5 >==================================================== >*print_inquire* checking file:/dev/pty10 >*print_inquire* file exists >*print_inquire* using unit number 0 >*print_inquire* access type SEQUENTIAL,FORMATTEDEven though the file is not a terminal but exists I get a name of "stdin". Other compilers return a null filename, others return the name of the redirected file. What if there was actually a file called "stdin"?
tty- </dev/null > for INPUT_UNIT=5 >==================================================== >*print_inquire* checking file:stdin >*print_inquire* file does not existTry these:
tty- # a simple call from the keyboard tty- </tmp/notthere # a file assumed to not exist tty- </dev/null # a special file that exists tty- </etc/passwd # some non-terminal file that exists tty- < tty # reading the pathname of your terminal tty- < /dev/pty08 # some TTY not assigned to your ID
Report _yes bugs to <http://www.urbanjost.altervista.org/index.html>
isatty(3c),tty(1), ttyname(3)
John S. Urban
Public Domain
Nemo Release 3.1 | tty- (1) | February 23, 2025 |