Date: Tue, 22 Mar 2016 04:08:50 +0100
From: Kamil Rytarowski <[email protected]>
Message-ID: <[email protected]>
| Redirecting fd >= 10 is rather a specialized use-case. Is it possible
| to detect it dynamically?
What we have now is just a bug. It will get fixed.
The standard sets no upper limit on fd - it says that values up to 9
should be supported (and at that the NetBSD shell does OK, assuming a few
caveats that do not usually apply) but allows for anything larger the
implementation can support. Good shells allow the user to use anything
that would be valid in a dup2() call (as the target). That's what we
should aim for. I believe earlier versions of the NetBSD shell used to
regard values > 9 as a syntax error. That (while sub-optimal) was OK.
The current shell just makes a mess of itself...
kre