diff options
author | David Adam <zanchey@ucc.gu.uwa.edu.au> | 2015-02-01 17:11:44 +0800 |
---|---|---|
committer | David Adam <zanchey@ucc.gu.uwa.edu.au> | 2015-02-01 18:18:34 +0800 |
commit | 66acd17bc02a8b3ff6292f1fc499b2712edf91f3 (patch) | |
tree | 6232dd3b3f54bdf2ce3d639fa9046bf8e7ebae45 /doc_src | |
parent | 793784c08778e8b3fb9d8a2a5621bd968db1dfbe (diff) |
isatty: revert to previous behaviour
This partially reverts commit 60808a4820b1714.
Diffstat (limited to 'doc_src')
-rw-r--r-- | doc_src/isatty.txt | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/doc_src/isatty.txt b/doc_src/isatty.txt index 91e5c9c7..f6ab500e 100644 --- a/doc_src/isatty.txt +++ b/doc_src/isatty.txt @@ -1,15 +1,17 @@ -\section isatty isatty - test if a file or file descriptor is a tty. +\section isatty isatty - test if a file descriptor is a tty. \subsection isatty-synopsis Synopsis \fish{synopsis} -isatty [FILE | DEVICE | FILE DESCRIPTOR NUMBER] +isatty [FILE DESCRIPTOR] \endfish \subsection isatty-description Description -`isatty` tests if a file or file descriptor is a tty. The argument may be in the form of a file path, device, or file descriptor number. Without an argument, `standard input` is implied. +`isatty` tests if a file descriptor is a tty. -If the resolved file descriptor is a tty, the command returns zero. Otherwise, the command exits one. No messages are printed to standard error. +`FILE DESCRIPTOR` may be either the number of a file descriptor, or one of the strings `stdin`, `stdout`, or `stderr`. + +If the specified file descriptor is a tty, the exit status of the command is zero. Otherwise, the exit status is non-zero. No messages are printed to standard error. \subsection isatty-examples Examples @@ -20,14 +22,14 @@ From an interactive shell, the commands below exit with a return value of zero: isatty isatty stdout isatty 2 -echo | isatty /dev/fd/1 +echo | isatty 1 \endfish And these will exit non-zero: \fish echo | isatty -isatty /dev/fd/9 +isatty 9 isatty stdout > file isatty 2 2> file \endfish |