Op 27-04-18 om 18:49 schreef Martijn Dekker:
The author of dash, Herbert Xu, said in response to my bug report that dash is not obligated to push and restore that file descriptor if it is already closed when entering the compound command -- implying that a file descriptor should not be pushed if the local state would be different from the parent state.

Actually, that implication that I understood is not even correct. No shell, not even bash and dash, outputs "oops, closed" for the following:

exec 8</dev/null
{
        exec 8<&-
} 8</dev/null  # local FD state same as parent
: <&8 || echo "oops, closed"

To rephrase my request: I would welcome opinions on whether the dash/bash behaviour shown in the original message should reasonably considered a bug in standards terms.

Thanks,

- M.

Reply via email to