summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-05-13 12:42:02 +0000
committerJim Meyering <jim@meyering.net>2003-05-13 12:42:02 +0000
commit4421b1a969f8bf19a6567b67d068e1048a1c40d3 (patch)
tree4e1d29a3c257a79e53a12df69eda5af5db93441a /doc
parent85664265123dcdd941fba00d15187453088719b2 (diff)
downloadcoreutils-4421b1a969f8bf19a6567b67d068e1048a1c40d3.tar.xz
(true invocation): Mention that it is possible to
make true --help or true --version (in non-POSIX mode) exit nonzero.
Diffstat (limited to 'doc')
-rw-r--r--doc/coreutils.texi13
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 18479cac7..e83eae522 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -8635,6 +8635,19 @@ options. However, that is contrary to @acronym{POSIX}, so when the environment
variable @env{POSIXLY_CORRECT} is set, @command{true} ignores @emph{all}
command line arguments, including @option{--help} and @option{--version}.
+Note, however, that it is possible to cause @command{true}
+to exit with nonzero status: when invoked in non-@acronym{POSIX} mode,
+with the @option{--help} or @option{--version} option, and with standard
+output already closed or redirected to a file that evokes an I/O error.
+For example, using a Bourne-compatible shell:
+
+@example
+$ ./true --version >&-
+./true: write error: Bad file number
+$ ./true --version > /dev/full
+./true: write error: No space left on device
+@end example
+
This version of @command{true} is implemented as a C program, and is thus
more secure and faster than a shell script implementation, and may safely
be used as a dummy shell for the purpose of disabling accounts.