P.S.:
Steffen Nurpmeso wrote in
<20250311175538.GDR_-iv4@steffen%sdaoden.eu>:
|Geoff Clare via austin-group-l at The Open Group wrote in
| <Z9Aqr5nseOcPND3d@localhost>:
||Christoph Anton Mitterer wrote, on 11 Mar 2025:
| ...
||> The remaining problem was that exec doesn't necessarily pass on
||> FDs > 2.
| ...
||> [.] and as shells *can* choose not to pass
||> on FDs > 2 [.]
||
||I think previous discussion identified ksh as the only shell which
||closes fds > 2; I would expect that in all other shells (or, at least,
||all the shells whose behaviour we usually pay attention to) n<&n is a
||no-op as long as fd n is already open. From my testing it looks like
||it is a no-op in bash, dash, mksh and zsh.
|
|I *think* kre@ has done this not too long ago for the NetBSD
|(a)sh. (In fact i *think* just ~"last week" a NetBSD old hander
|came over with problems because the newest NetBSD ships with this
|updated shell, but it was their usual long thread and i only
|shortly had a look.)
I remember now that the thread was about something entirely
different, namely fd>10 variable names requiring braces aka $11
being effectively ${1}1 not ${11}, which NetBSD sh now honours.
(Still i think it now closes fds..)
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)