Ralph Corderoy wrote:
> ... But a regular file ./foo on disk does look different and it
> still seems odd that
> printf '\n\n\n\n\n\n\n\n\n\n\n\n' >foo
> does a dozen one-byte write(2)s.
But the only reason you know that there is a long string of newlines
is that your eye is looking over the
> > Almost exactly right, except replace "unbuffered" with "line-buffered
> > output". Bash uses stdio and sets stdout and stderr to line-buffered.
> > The advantage of fully-buffered mode shows itself when writing large
> > amounts of data, which the shell does not do very often. The
> > advanta
Hi Chet,
> > I see why it's line-buffered when writing to a terminal, but when
> > bash changes where stdout points it has the option to setvbuf(3) or
> > similar too based on what it knows about the destination, e.g.
> > /dev/pts/3 versus /tmp/foo versus /dev/udp/0x7f01/4242. Does it
> > nev