bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#23090: true and false not POSIX


From: Stephane CHAZELAS
Subject: bug#23090: true and false not POSIX
Date: Tue, 22 Mar 2016 20:19:37 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]