On January 28, 2004 02:17 pm, Diego Zamboni wrote:
> > i run "cvs update > /dev/null" or "cvs update | sed -e
> > 's/<expression>/yyy/'" it still prints the same thing it always does. 
> > how do i capture this information?
>
> cvs prints many of its messages to standard error (STDERR) instead of
> standard output. In bourne-like shells (including bash), you use 2>
> instead of > to redirect stderr (in csh-like shells it's different). See
> the bash (or csh) man page for more information. Additionally, Google
> found these pages with some information and examples:
>
>         http://tomecat.com/jeffy/tttt/shredir.html
>         http://www.losurs.org/docs/redirection
>
> In your example, if you wanted to pass both stdout and stderr (this is,
> everything cvs prints out) to a command, you could simply do:
>
> cvs update 2>&1 | sed -e 's/<expression>/yyy/'
>
> If you wanted to pass only stderr, it gets more complicated:
>
> (cvs update > /dev/null) 2>&1 | sed -e 's/<expression>/yyy/'
>
> Again: these examples work only in Bourne shell and its derivatives.

wow, thanks.  just one last question:  why does cvs do this?  isn't STDOUT the 
"standard" place to pipe outgoing information?

-- 
problems cannot be solved at the same level of awareness that created them.
        - albert Einstein


--
[EMAIL PROTECTED] mailing list

Reply via email to