On 02/07/2010 07:30 PM, Tony Abou-Assaleh wrote:
Regardless of what the root cause of the problem is, clearly the
behaviour does not match the user's expectations under normal usage.
Agreed. However, what about
grep -r foo | tee somefile
? I think that while the behavior is not matching the user's
expectations, it is matching exactly the user's request.
But based on Paolo's remarks I wonder whether the problem lies deeper
within how GNU/Linux handles files
No, the problem would be there in any OS. Buffering can hide it, but if
you disabled buffering you'd see it in all cases: "grep PATTERN FILE >>
FILE" would loop if and only if at least one line in FILE matched PATTERN.
Paolo