Re: Bug#270868: Should not implement "test" builtin
> I think that he is saying that the test command is specified by POSIX
> qua standalone program, not qua shell builtin. As such it falls outside
I don't see how that distinction is meaningful at all.
> the purview of policy clause 10.4 which tells script authors not to use
> non-POSIX features of _shells_. Clause 10.4 doesn't tell script authors
> not to use non-POSIX features of standalone programs. Why should it?
> The purpose of 10.4 is to promote the portability of scripts across
> POSIX-compliant shells, not to promote the portability of scripts to
> other distributions.
Now I question the significance you see in "standalone program".
> The actual list of built-in utilities specified by POSIX[1] is:
>
> break, colon, continue, dot, eval, exec, exit, export, readonly,
> return, set, shift, times, trap, unset,
>
> 'test' is not on this list.
Neither is 'cd'.
> If the reasoning above is correct then this feature of posh imposes a
> restriction on scripts that isn't warranted by policy. If the purpose
> of posh is to facilitate the testing of scripts' policy-compliance
> then the "test" builtin should not be included.
Does that also apply to "break", "cd", "command", ":", "continue",
".", "echo", "eval", "exec", "exit", "export", "kill", "read",
"readonly", "return", "set", "shift", "times", "trap", "ulimit",
"unset", and "wait"?
If there are any of these that you feel should be removed along with
"test", why shouldn't they be removed from all other shells as well?
> Are you saying that policy requires that scripts refrain from using all
> non-POSIX features of all programs whose minimum functionality is
> specified by POSIX?
One could read it that way. I would suggest using the full path to
coreutils programs if that's the syntax you desire.
But requiring support for test "-a"/"-o" is a bad idea however you word
it.
Reply to: