> ---------------------------------------------------------------------- > (0007025) McDutchie (reporter) - 2024-12-19 20:21 > https://austingroupbugs.net/view.php?id=1896#c7025 > ---------------------------------------------------------------------- > Thanks to @larryv for the correction. I should have tested old bash > versions. > > Another 'exec' thing, I'm not sure if it's worth opening a separate issue. > Lines 82762-82764 state: <blockquote>If any file descriptors with numbers > greater than 2 are opened by those redirections, it is unspecified whether > those file descriptors remain open when the shell invokes another > utility.</blockquote> I assume this was to allow for the behaviour of > ksh93, which opens file descriptors > 2 close-on-exec when they are > redirected with exec. But, in the POSIX mode on ksh 93u+m, I've disabled > that behaviour for compatibility with other shells. To the best of my > knowledge, ksh93 has always been the only shell with this behaviour. So I > think POSIX can now specify that they stay open.
Ksh88 also did/does it; it is still used as the POSIX sh on some current systems (at least Solaris /usr/xpg4/bin/sh and AIX /bin/sh). So POSIX shouldn't disallow that close-on-exec behaviour unless/until those systems change their POSIX sh to stop doing it. -- Geoff Clare <[email protected]> The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England
