This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: bash : stderr & more (pipe for stderr)
- From: Randall R Schulz <rschulz at sonic dot net>
- To: cygwin at cygwin dot com
- Date: Sat, 14 Jun 2003 15:07:46 -0700
- Subject: Re: bash : stderr & more (pipe for stderr)
Alex,
At 00:25 2003-06-14, Alex Vinokur wrote:
$ <command> | more # works only for stdout
$ <command> |& more
bash: syntax error near unexpected token `&'
How to use pipe for stderr?
BASH uses the Bourne and Korn shell syntax for redirection. You're
using the CSH / tcsh variety.
# Redirect standard out and standard error separately
% cmd >stdout-redirect 2>stderr-redirect
# Redirect standard error and out together
% cmd >stdout-redirect 2>&1
# Merge standard error with standard out and pipe
% cmd 2>&1 |cmd2
Randall Schulz
Thanks,
Alex Vinokur
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/