bash one-liners with multiple pipes

daniel danstemporaryaccount-FFYn/CNdgSA at public.gmane.org
Tue May 11 15:40:34 UTC 2004


On May 11, 2004 11:04 am, Henry Spencer wrote:
> On Tue, 11 May 2004, daniel wrote:
> > ...unfortuneately though, while this works...
> > this doesn't:
>
> What does the latter do, or not do?  "doesn't" is not very specific. :-)

heh.  unfortuneatly, "doesn't" is about the best description i can give it.  
using a few simple tests like grepping out "jpg" and visiting the blog 
myself, produces no output -- even though i know that more stuff has been 
appended to the log that would normally appear.

> One problem with any attempt to run real-time output through pipes is that
> many programs buffer output that's going to a pipe, waiting until they
> have a full buffer before they actually write it out.  You will still get
> the same output... eventually... but whether you get it *promptly* depends
> on little details, and is effectively unpredictable.

now this is new to me.  i didn't know programs did this sort of thing.  how 
can i find out if this is the case?  the issue seems to come up whenever i 
pipe a 3rd process ie. "tail | awk | grep..."  but since "tail | grep" seems 
to work, maybe there's some sort of environment variable i can set to *not* 
buffer the output?  i'm stumbling around in the dark here.

-- 
for every complex problem
there is a simple solution

and it's wrong.
  - unknown

--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list