diff options
author | Jim Meyering <jim@meyering.net> | 2001-04-20 17:33:43 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-04-20 17:33:43 +0000 |
commit | 45c63978485ec400640aacc782dd9d3c6171d3be (patch) | |
tree | 0d017d0fbec6639e2d60357e17e0e1ca458ca6cd /doc | |
parent | 50d41186a429feeefcd6f003a20e3b29a1b82f29 (diff) | |
download | coreutils-45c63978485ec400640aacc782dd9d3c6171d3be.tar.xz |
(false invocation): Describe how --help and
--version are treated with and without POSIXLY_CORRECT.
(true invocation): Likewise.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/sh-utils.texi | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/doc/sh-utils.texi b/doc/sh-utils.texi index 4670b30d4..08d528aca 100644 --- a/doc/sh-utils.texi +++ b/doc/sh-utils.texi @@ -427,9 +427,10 @@ pipeline. @dfn{failure}. It can be used as a place holder in shell scripts where an unsuccessful command is needed. -@code{false} ignores @emph{all} command line arguments, even @samp{--help} -and @samp{--version}, since to do otherwise would change expected -behavior that some programmers may be relying on. +By default, @code{false} honors the @samp{--help} and @samp{--version} +options. However, that is contrary to @sc{POSIX}, so when the environment +variable @env{POSIXLY_CORRECT} is set, @code{false} ignores @emph{all} +command line arguments, including @samp{--help} and @samp{--version}. This version of @code{false} is implemented as a C program, and is thus more secure and faster than a shell script implementation, and may safely @@ -448,11 +449,15 @@ be used as a dummy shell for the purpose of disabling accounts. @code{true} does nothing except return an exit status of 0, meaning @dfn{success}. It can be used as a place holder in shell scripts where a successful command is needed, although the shell built-in -command @code{:} (colon) does the same thing faster. - -@code{true} ignores @emph{all} command line arguments, even @samp{--help} -and @samp{--version}, since to do otherwise would change expected -behavior that some programmers may be relying on. +command @code{:} (colon) may do the same thing faster. +In most modern shells, @code{true} is built-in command, so when +you use @samp{true} in a script, you're probably using the built-in +command, not the one documented here. + +By default, @code{true} honors the @samp{--help} and @samp{--version} +options. However, that is contrary to @sc{POSIX}, so when the environment +variable @env{POSIXLY_CORRECT} is set, @code{true} ignores @emph{all} +command line arguments, including @samp{--help} and @samp{--version}. This version of @code{true} is implemented as a C program, and is thus more secure and faster than a shell script implementation, and may safely |