aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/isatty.txt
diff options
context:
space:
mode:
Diffstat (limited to 'doc_src/isatty.txt')
-rw-r--r--doc_src/isatty.txt35
1 files changed, 28 insertions, 7 deletions
diff --git a/doc_src/isatty.txt b/doc_src/isatty.txt
index d3b52892..f6ab500e 100644
--- a/doc_src/isatty.txt
+++ b/doc_src/isatty.txt
@@ -1,14 +1,35 @@
-\section isatty isatty - test if the specified file descriptor is a tty
+\section isatty isatty - test if a file descriptor is a tty.
\subsection isatty-synopsis Synopsis
- <tt>isatty [FILE DESCRIPTOR]</tt>
+\fish{synopsis}
+isatty [FILE DESCRIPTOR]
+\endfish
\subsection isatty-description Description
-<tt>isatty</tt> tests if a file descriptor is a tty.
-<tt>FILE DESCRIPTOR</tt> may be either the number of a file descriptor, or one of the
-strings <tt>stdin</tt>, \c stdout and <tt>stderr</tt>.
+`isatty` tests if a file descriptor is a tty.
-If the specified file descriptor is a tty, the exit status of the command is
-zero. Otherwise, it is non-zero.
+`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
+
+From an interactive shell, the commands below exit with a return value of zero:
+
+\fish
+isatty
+isatty stdout
+isatty 2
+echo | isatty 1
+\endfish
+
+And these will exit non-zero:
+
+\fish
+echo | isatty
+isatty 9
+isatty stdout > file
+isatty 2 2> file
+\endfish