From: Paul Eggert Date: Mon, 18 Jul 2005 07:51:32 +0000 (+0000) Subject: (false invocation): X-Git-Tag: CPPI-1_12~239 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8445b707fdc441cdb45ccb423aa3dc9cb80571fc;p=thirdparty%2Fcoreutils.git (false invocation): Mention that false is often built-in, and that it exits with status >1 on some hosts. (true invocation): Remove now-incorrect "non-POSIX mode" reference. --- diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 6fd1cc20e1..68e8e62c7a 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -9577,6 +9577,9 @@ pipeline. @command{false} does nothing except return an exit status of 1, meaning @dfn{failure}. It can be used as a place holder in shell scripts where an unsuccessful command is needed. +In most modern shells, @command{false} is a built-in command, so when +you use @samp{false} in a script, you're probably using the built-in +command, not the one documented here. @command{false} honors the @option{--help} and @option{--version} options. @@ -9588,6 +9591,10 @@ Note that @command{false} (unlike all other programs documented herein) exits unsuccessfully, even when invoked with @option{--help} or @option{--version}. +Portable programs should not assume that the exit status of +@command{false} is 1, as it is greater than 1 on some +non-@acronym{GNU} hosts. + @node true invocation @section @command{true}: Do nothing, successfully @@ -9609,8 +9616,8 @@ command, not the one documented here. @command{true} honors the @option{--help} and @option{--version} options. 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 +to exit with nonzero status: 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: