On 10/06/2019 19:22, Chet Ramey wrote:
On 6/10/19 2:15 PM, Harald van Dijk wrote:

Re: http://austingroupbugs.net/view.php?id=760#c4411 <&0 is a no-op, so it's
unclear whether it counts as
"explicit redirection of standard input".

In almost all shells, <&0 is not a no-op. It is a check that stdin is open.
It will cause an immediate error without executing any command otherwise.
By my reading of the standard, this is the required behaviour and it is a
(minor) bug for a few shells to implement it as a no-op.

"Almost all shells" is an exaggeration. Of the shells I tested, ksh93,
mksh, and the NetBSD sh treat it as an error. Bash, dash, yash, the SVR4.2
sh, and the FreeBSD sh ignore it or optimize it away.

I do not think it is an exaggeration.

FreeBSD sh and dash have a common ancestor should not be considered as separate shells here as this behaviour dates back to before dash even existed.

You miscategorised yash: it treats it as an error in POSIX mode.

bosh, pdksh, posh and zsh also treat it as an error.

Cheers,
Harald van Dijk

Reply via email to