Re: Use of tee(2) to speedup reading from pipes
Chet Ramey <[email protected]>
| Newsgroups | gmane.comp.shells.bash.bugs |
|---|---|
| Organization | ITS, Case Western Reserve University |
| Message-ID | <[email protected]> |
On 8/23/26 6:45 PM, Sam James wrote: > Hi, > > bash currently probes a pipe w/ lseek, sees it isn't seekable, and then > falls back to reading 1 byte at a time. OK. Are we talking about the parser reading input, the read builtin, or mapfile? I'm not that familiar with tee(2), since it's Linux-specific. I guess the idea would be to tee the input pipe into another random pipe, read all the data from that second pipe, scan forward for the delimiter (which differs depending on context), then read that many bytes from the input pipe (up to the number of bytes returned by tee)? Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU [email protected] http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
(application/pgp-signature, 203 B)
-----BEGIN PGP SIGNATURE----- wmMEABEIACMWIQR8ATX7CIqvbGbGULm7WGnwZOp0qwUCaoxOZQUDAAAAAAAKCRC7WGnwZOp0qx6/ AKCH670ksZPsfw+Xuo0qoojO2yjlGQCgk3vVY/4Jn1v8zHXSZ119ndvydXU= =rP8a -----END PGP SIGNATURE-----