Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Mar 2001 16:38:07 +0800
From:      David Xu <bsddiy@21cn.com>
To:        "Crist J. Clark" <cjclark@reflexnet.net>
Cc:        "Jerry Y. Wang" <dimension10@earthlink.net>, cjclark@alum.mit.edu, freebsd-questions@FreeBSD.ORG
Subject:   Re[2]: Redirecting stderr to syslog ...
Message-ID:  <14428093656.20010307163807@viasoft.com.cn>
In-Reply-To: <20010307000552.I1367@cjc-desktop.users.reflexcom.com>
References:  <Pine.BSF.4.33.0103060701220.859-100000@mobile.hub.org> <3AA52914.EB033F18@journalstar.com> <20010306231007.A36586@dragon.jerrywang.dyndns.org> <20010307000552.I1367@cjc-desktop.users.reflexcom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello Crist,

Wednesday, March 07, 2001, 4:05:53 PM, you wrote:

CJC> On Tue, Mar 06, 2001 at 11:10:07PM -0800, Jerry Y. Wang wrote:
>> That does not work in tcsh or csh.

CJC> I believe it was a typo. The syntax is,

CJC>   program1 | 2>&1 program2

CJC> For sh-like shells.

CJC>   program1 |& program2

CJC> For csh-like.

>> On Tue, Mar 06, 2001 at 12:14:44PM -0600, Tony Wells wrote:
>> > If you want to re-direct both stdout and stderr you could use:
>> > <prog> 2>&1 <file or whatever>
>> > 
>> > The Hermit Hacker wrote:
>> > > 
>> > > If I want to redirect stderr to a file, in tcsh, I do:
>> > > 
>> > >         <prog> >& <file>
>> > > 
>> > > If I want to redirect stdout to syslog, I do:
>> > > 
>> > >         <prog> | logger -p <pri>
>> > > 
>> > > How would one redirect stderr to syslog?
>> > > 
>> > > Thanks ...
>> > > 
>> > > Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
>> > > Systems Administrator @ hub.org
>> > > primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org
>> 
>> To Unsubscribe: send mail to majordomo@FreeBSD.org
>> with "unsubscribe freebsd-questions" in the body of the message

From csh manual page, I got:

       Diagnostic output may be directed through a pipe with  the
       standard  output.   Simply  use  the form `|&' rather than
       just `|'.

       The shell  cannot  presently  redirect  diagnostic  output
       without  also redirecting standard output, but `(command >
       output-file)  >&  error-file'  is  often   an   acceptable
       workaround.   Either  output-file  or  error-file  may  be
       `/dev/tty' to send output to the terminal.

it seems I can not separate stderr from stdout.

-- 
Best regards,
David Xu



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14428093656.20010307163807>