[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: strange grep or tail behaviour



Replying to my own message...

I should have looked in the Unix FAQ first :) I believe the answer was in
3.14. It has to do with the amount of buffering.
http://www.faqs.org/faqs/unix-faq/faq/part3/section-14.html

I did receive some off-list emails about this. One used strace to see that
it was buffered. (Thank you.) Another simply said "man tail" -- well I
already read the manpage and info page for it; I must have missed
something; please share specific details.

I guess as a workaround I could just use a single instance of awk, sed,
grep, perl or a simple bash script to solve my problem. Or I could
find and modify a BSD-licensed grep to not buffer the output.

Does anyone know of a grep that can use multiple expressions
that some are reversed, for example, one grep that can do the same as
"grep keyword | grep -v exclude" (without knowing the placement of the
keywords in the line)?

Or can anyone share some examples of using awk to do this?

  Jeremy C. Reed



Reply to: