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

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 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-20 Thread jellybean stonerfish
On Wed, 20 Jan 2010 07:34:35 -0800, CptDpondo wrote: > Note that it's using \r instead of \n for line breaks; that's to > overwrite the status line without scrolling the screen. this works fine > when displaying on a terminal. > > I'm trying to reduce this to where it only prints the status lin

weird bash pipe behavior

2010-01-20 Thread CptDpondo
I'm trying to set up a pipe and it's not doing what I expect. By way of background, I'm using mencoder to create a video file. mencoder prints a status line every 0.1 seconds in the following format: Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. videocodec: libavcodec (704x464 four