<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#0000ff">Chet - as I said, we tried so hard to keep that kind of crap out. Dennis was right. FWIW: with UNIX (POSIX), input will end if an EOF and the ANSI C untilies will obey it or a newline, so you can write the code to work fine either way. But that's a choice of implementation/what subroutines - how you think about the data.</font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#0000ff"><br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#0000ff">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. I think the core standard still says that, and the basic idea is unchanged. The actual structure of the input file is an application idea, not a UNIX/POSIX defined idea.</font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#0000ff"><br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#0000ff">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) which might put structure onto the file and that's fine. The >>OS<< does not set the structure — it is done by something else. </font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#0000ff"><br></font></div><div class="gmail_default" style=""><font color="#0000ff" style="font-family:arial,helvetica,sans-serif">I understand having the application do it; I wish it did not. Many applications (even text editors) can (and have) been written without needing one specific structure, which is my point. I also accept that the folks who took over the standard in the name of "progress" changed (relaxed) much of what we worked so hard to avoid, knowing there were dragons - particularly WRT to textual information. We really did not want to repeat the errors of the 1960s. <i> </i></font><i><font color="#0000ff">i.e.</font></i><font color="#0000ff" style="font-family:arial,helvetica,sans-serif">, as George Santayana originally wrote, <i>“Those who cannot remember the past are condemned to repeat it.” </i></font></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=aY2xlbWNAY2NjLmNvbQ%3D%3D&type=zerocontent&guid=114d7f3a-4bfd-442f-8dc9-07a6fd6eaac0"><font color="#ffffff" size="1">ᐧ</font></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Mar 27, 2025 at 3:05 PM Chet Ramey <<a href="mailto:chet.ramey@case.edu">chet.ramey@case.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/27/25 3:00 PM, Clem Cole wrote:<br>
> Argh -- I standard corrected. We worked hard at the beginning to keep that <br>
> crap out -- sigh.<br>
> <br>
> But at least is does says: POSIX.1-2024 /_does not _//_distinguish between <br>
> text files and binary files_/ (see the ISO C standard)<br>
<br>
It also says "The standard utilities that have such restrictions always<br>
specify "text files" in their STDIN or INPUT FILES sections," so you can't<br>
avoid it.<br>
<br>
awk is one such utility (sh is not). This is an application requirement, so<br>
awk is required to add a newline at the end of a file that does not have<br>
one.<br>
<br>
-- <br>
``The lyf so short, the craft so long to lerne.'' - Chaucer<br>
``Ars longa, vita brevis'' - Hippocrates<br>
Chet Ramey, UTech, CWRU <a href="mailto:chet@case.edu" target="_blank">chet@case.edu</a> <a href="http://tiswww.cwru.edu/~chet/" rel="noreferrer" target="_blank">http://tiswww.cwru.edu/~chet/</a><br>
</blockquote></div>