What is Nostr?
Jan Schaumann /
npub1z6e…ehl4
2024-08-20 21:36:35

Jan Schaumann on Nostr: TIL: #NetBSD / macOS lets you change stdio buffering behavior via the STDBUF env ...

TIL: #NetBSD / macOS lets you change stdio buffering behavior via the STDBUF env variable (see setbuf(3)). Similar to GNU stdbuf(1), but a lot less cumbersome:

Default behavior, pipe I/O is fully buffered, wait forever to get output:

while sleep 1; do echo TEST; done | grep . | grep .

Make it line-buffered:

export STDBUF=L; while ...

Buffer 25 bytes:

export STDBUF=F25; while ...

Via Julia Evans (npub1hyj…avly)/112995960680348851">https://mstdn.social/Julia Evans (npub1hyj…avly)/112995960680348851 and https://blog.plover.com/Unix/stdio-buffering-2.html.
Author Public Key
npub1z6e60xgyfcjq42deezd8695tp5ne08dkxqs7acg40ntmcrr23arsjwehl4