mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-28 16:01:15 -03:00
Copy doc_src to sphinx_doc_src and add a TOC
This commit is contained in:
35
sphinx_doc_src/cmds/isatty.rst
Normal file
35
sphinx_doc_src/cmds/isatty.rst
Normal file
@@ -0,0 +1,35 @@
|
||||
\section isatty isatty - test if a file descriptor is a tty.
|
||||
|
||||
\subsection isatty-synopsis Synopsis
|
||||
\fish{synopsis}
|
||||
isatty [FILE DESCRIPTOR]
|
||||
\endfish
|
||||
|
||||
\subsection isatty-description Description
|
||||
|
||||
`isatty` tests if a file descriptor is a tty.
|
||||
|
||||
`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
|
||||
Reference in New Issue
Block a user