mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-30 01:11:14 -03:00
We no longer have two doc systems, move sphinx_doc_src back to doc_src
This commit is contained in:
48
doc_src/cmds/isatty.rst
Normal file
48
doc_src/cmds/isatty.rst
Normal file
@@ -0,0 +1,48 @@
|
||||
.. _cmd-isatty:
|
||||
|
||||
isatty - test if a file descriptor is a terminal
|
||||
================================================
|
||||
|
||||
Synopsis
|
||||
--------
|
||||
|
||||
::
|
||||
|
||||
isatty [FILE DESCRIPTOR]
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
``isatty`` tests if a file descriptor is a terminal (as opposed to a file). The name is derived from the system call of the same name, which for historical reasons refers to a teletypewriter (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 terminal device, the exit status of the command is zero. Otherwise, the exit status is non-zero. No messages are printed to standard error.
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
From an interactive shell, the commands below exit with a return value of zero:
|
||||
|
||||
|
||||
|
||||
::
|
||||
|
||||
isatty
|
||||
isatty stdout
|
||||
isatty 2
|
||||
echo | isatty 1
|
||||
|
||||
|
||||
And these will exit non-zero:
|
||||
|
||||
|
||||
|
||||
::
|
||||
|
||||
echo | isatty
|
||||
isatty 9
|
||||
isatty stdout > file
|
||||
isatty 2 2> file
|
||||
|
||||
Reference in New Issue
Block a user