2 ms·
Definitely not my area of either pedantry or expertise, but if I read this correctly: > The input file can be of any type, but the initial portion of the file
by yawpitch 2y ago
Definitely not my area of either pedantry or expertise, but if I read this correctly:
> The input file can be of any type, but the initial portion of the file intended to be parsed according to the shell grammar […] shall consist of characters and shall not contain the NUL character.
Then POSIX doesn’t proscribe against appending binary data at all, it just requires that binary data appears after whatever portion of the file is intended to be parsed according to the grammar… there’s nothing stating that intention can’t apply to a zero characters.
> The shell shall not enforce any line length limits.
That seems to unambiguously allow a zero-length initial portion.
> If the input file consists solely of zero or more blank lines and comments, sh shall exit with a zero exit status.
And so does that, while also making an enormous loophole for any input file that is not zero or more blank lines.
In other words it seems to me on a quick reading that a decent rules-lawyer could drive a planet through that part of the spec, as written.