Date: Mon, 10 Jun 2019 20:42:35 +0100
From: Harald van Dijk <[email protected]>
Message-ID: <[email protected]>
| NetBSD sh changed this (for other reasons) only in 2016, if I am reading
| the history correctly.
Was it that long ago? Possibly ...
| Before then, it behaved the same as FreeBSD sh and dash.
Yes, it did.
FWIW, the "other reasons" are that the NetBSD shell also treats this
as a "turn off close on exec" instruction - an explicit instruction
that the calling shell's fd N is to be passed to the command to be
executed - which isn't really relevant when N==0 but can be for N>2.
(this is for N<&N type redirections, both < and >).
| The FreeBSD sh change I was looking at that introduced this there was
| from 1995 (before which n<&n was just plain broken) and has not changed
| since.
In the mid 90's lots of things were just plain broken in ash derived shells.
Despite which, it still worked well enough to be functional for almost
everything that is encountered by normal scripts (ones not setting out
with the aim of torturing the shell...)
kre