|
From: | Paolo Bonzini |
Subject: | Re: [bug #17457] "grep -r foo . > somefile" goes into an infinite loop |
Date: | Mon, 08 Feb 2010 09:24:32 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.1 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |