On 3/30/25 10:00 AM, arnold(a)skeeve.com wrote:
Doug,
It turns out there wasn't enough context and we both got
confused. The "requirement" is that
awk '{ print }' ...
look to the lexer / grammer as if it had been "{ print }\n".
There is no requirement that input "text" files behave as if a
final newline is always there.
There's a similar situation with `sh -c', since sh can treat the end of the
string as a command terminator. The rationale notes it:
"Earlier versions of this standard required that input files to the shell
be text files except that line lengths were unlimited. However, that was
overly restrictive in relation to the fact that shells can parse a script
without a trailing newline[.]"
Chet
--
``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/