head behaviour

Doug Barton dougb at FreeBSD.org
Sat Jun 5 21:02:19 UTC 2010


On 06/05/10 13:48, Bakul Shah wrote:
> Without running the following can you guess its output?
>
> $ look '' | (head -2; head -2)

Again, it's not clear to me what you expect is going to happen with the 
second 'head -2' there. I agree that the actual output of your example 
is wacky and unexpected, but what I'm trying to get you say is what YOU 
think should happen. The examples that you pasted in your previous post 
did not and could not do what you said you wanted them to do, so I don't 
quite understand what the bug is.

Put more simply, if you generate wacky command lines you should not be 
surprised when they produce wacky results. :)


Doug


On two occasions I have been asked [by members of Parliament!], "Pray, 
Mr. Babbage, if you put into the machine wrong figures, will the right 
answers come out?"  I am not able rightly to apprehend the kind of 
confusion of ideas that could provoke such a question.
		-- Charles Babbage

-- 

	... and that's just a little bit of history repeating.
			-- Propellerheads

	Improve the effectiveness of your Internet presence with
	a domain name makeover!    http://SupersetSolutions.com/



More information about the freebsd-hackers mailing list