Re: weird bash pipe behavior

2010-01-21 Thread Greg Wooledge
On Wed, Jan 20, 2010 at 07:34:35AM -0800, CptDpondo wrote: > mencoder 2>&1 | tr '\r' '\n' | grep -v -B 1 '^Pos' > > this eventually creates the correct output, but it's buffered until > mencoder completes. I have no idea why; the tr command streams > without buffering and I've used grep for

Re: weird bash pipe behavior

2010-01-21 Thread Yan Seiner
Greg Wooledge wrote: On Wed, Jan 20, 2010 at 07:34:35AM -0800, CptDpondo wrote: mencoder 2>&1 | tr '\r' '\n' | grep -v -B 1 '^Pos' this eventually creates the correct output, but it's buffered until mencoder completes. I have no idea why; the tr command streams without buffering and I'

Re: weird bash pipe behavior

2010-01-21 Thread Greg Wooledge
On Thu, Jan 21, 2010 at 06:11:10AM -0800, Yan Seiner wrote: > Greg Wooledge wrote: > >grep definitely has this buffering behavior. If you're using GNU grep, > >you can give it the --line-buffered option to change this, at least > >according to whichever contributor added that one to > >http://mywi