[TUHS] non-Posix input files

Chet Ramey via TUHS tuhs at tuhs.org
Mon Mar 31 07:45:27 AEST 2025


On 3/30/25 10:00 AM, arnold at 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 at case.edu    http://tiswww.cwru.edu/~chet/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20250330/7164a73b/attachment.sig>


More information about the TUHS mailing list