bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cut loadable outputs extra newlines


From: Chet Ramey
Subject: Re: cut loadable outputs extra newlines
Date: Mon, 15 Aug 2022 10:00:12 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.1.2

On 8/13/22 10:06 PM, Martin D Kealey wrote:
I note that https://pubs.opengroup.org/onlinepubs/009696699/utilities/cut.html <https://pubs.opengroup.org/onlinepubs/009696699/utilities/cut.html> says: /> The elements in list can be repeated, can overlap, and can be specified in any order, but the bytes, characters, or fields selected shall be written in the order of the input data./

The intention behind this is so that cut can be implemented as a small state machine using just getchar, putchar, and a counter.

I wrote `lcut' first, then adapted it for `cut'.

This avoids copying via a line buffer, and that implies there should be no line-length limit.

zgetline has no line length limit.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]