On Nov 03, 2007, at 12:43:06, Ahmed S. Darwish wrote:
Actually, what causes problems here is something between a bug and a
feature in libc's buffering. Basically the -EINVAL error causes libc
to leave its data in the file-output buffer despite the file being
closed and reopened. Since a standalone echo just exits that buffer
is discarded, but for the bash builtin it hangs around in the buffer
for a while and ends up getting prepended to the following echo
statement. There's actually multiple ways to make this fail; this is
just the simplest.
Cheers,
Kyle Moffett
-