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    c...@case.edu    http://tiswww.cwru.edu/~chet/


Reply via email to