Sam James <[email protected]> writes: > Hi, > > bash currently probes a pipe w/ lseek, sees it isn't seekable, and then > falls back to reading 1 byte at a time. > > A few years ago, dash adopted [0] use of tee(2) to peek at the contents > of stdin and read the amount of bytes left instead rather than 1. > > Could this be considered for bash too? My interest in this is partly > speed but also to avoid a lot of noisy read()s of size 1 which can > obfuscate actual problems and can be hard to decipher (as you have to > concatenate the values from each line mentally).
I found https://lists.gnu.org/archive/html/bug-bash/2021-05/msg00001.html as well after some more searching. > > [0] 44b15ea09a9ee5872cf477e4ffc6b42ef37d1e46 with some followups > afterwards in 1713d1d6592f09f23b5abfb4562cbe5a7615fb1a, > 41457be81fa7b45af9d9ca402454fee0e555620f, > and 0679594e72403f4a6d7890e627b75816f6feb0d5. > > thanks, > sam
signature.asc
Description: PGP signature
