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.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/