emersion / mrsh

A minimal POSIX shell
MIT License
489 stars 35 forks source link

builtin/exec: add support for no argument #136

Closed emersion closed 4 years ago

emersion commented 4 years ago

Not sure how to interpret this part of the spec:

If exec is specified without command or arguments, and any file descriptors with numbers greater than 2 are opened with associated redirection statements, it is unspecified whether those file descriptors remain open when the shell invokes another utility.

Does that mean using exec to open FDs is undefined behaviour?

ddevault commented 4 years ago

Hm, I think that interpretation is correct. Which is pretty lame.