GNU bug report logs -
#23090
true and false not POSIX
Previous Next
Reported by: Ruediger Meier <sweet_f_a <at> gmx.de>
Date: Tue, 22 Mar 2016 12:44:02 UTC
Severity: normal
Tags: notabug
Done: Eric Blake <eblake <at> redhat.com>
Bug is archived. No further changes may be made.
Full log
Message #66 received at 23090 <at> debbugs.gnu.org (full text, mbox):
2016-03-22 12:31:50 -0700, Paul Eggert:
[...]
> It might be helpful to have some other environment variable that
> meant "try to be strict about supporting only behavior required by
> POSIX", as one could use that to develop shell scripts that were
> more portable. However, that would be a lot of work to implement,
> and it's not clear it's worth the hassle to develop, maintain, and
> document. Plus, POSIX does not always specify behavior, so
> portability wouldn't be guaranteed by this.
But then in that environment, true --help would report an error:
true: no argument allowed
and exit with a non-zero exit status like when other non-POSIX
extensions are not supported. It wouldn't make true more POSIX
conformant but it would help people write POSIX scripts by
telling them the feature they rely on (true ignoring arguments)
is not standard.
The OP's request was primarily about increasing portability with
other true implementation where in "true --help", the "--help"
argument is ignored.
I agree POSIX true doesn't accept arguments, but before GNU
"true" started accepting --help, --version, you could do
portably (if not standardly):
true "$args" to be ignored
--
Stephane
This bug report was last modified 9 years and 61 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.