On 3/27/25 3:35 PM, Clem Cole wrote:
Chet - as I said, we tried so hard to keep that kind
of crap out.
I believe you!
Even the first published version of 1003.2, in 1992, says
"The definition of text file has caused controversy." and discusses how
the definition seemingly outlaws empty files.
I'll accept that that is what the words say in
the >>awk<< specification
document, but as one of the original authors of the first UNIX standard and
the later POSIX standard I can say we tried hard to mak sure we got it
right and follow the idea: A regular file has no structure and never to
allow the standard to impose it.
Sure. I think the point is that there are a bunch of utilities, like awk,
bc, ed, sort, and so on, whose input is required to be a text file as
defined by the standard. troff isn't in the standard, so Branden can do
what he likes, and if he wants to accept text files as the standard defines
them, then ok.
The issue here is the term POSIX. Do you mean it to
be the kernel (.1)
and if a >>specific<< application with .2 (the C compiler itself, awk, ed)
There is no distinction like that any more. POSIX is all of it: shell,
utilities, library functions, system calls. The standard guarantees that
where an input file is required to be a text file it is explicitly
mentioned, and it does that.
I understand having the application do it; I wish it
did not.
Sorry, jargon. The application is the thing that calls awk; awk is a
utility (expressive shrug).
So whatever calls awk is responsible for making sure the script and any
input files are text files. awk can add a newline to the end of a script
file that doesn't have one, so the grammar works right. It's also entitled
to do whatever it wants, including throw an error, if the input file isn't
a text file.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet(a)case.edu
http://tiswww.cwru.edu/~chet/