From owner-freebsd-questions Wed Mar 7 0:41: 7 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail.viasoft.com.cn (unknown [61.153.1.177]) by hub.freebsd.org (Postfix) with ESMTP id E42B337B718 for ; Wed, 7 Mar 2001 00:41:02 -0800 (PST) (envelope-from bsddiy@21cn.com) Received: from William ([192.168.1.98]) by mail.viasoft.com.cn (8.9.3/8.9.3) with ESMTP id QAA15552; Wed, 7 Mar 2001 16:33:30 +0800 Date: Wed, 7 Mar 2001 16:38:07 +0800 From: David Xu X-Mailer: The Bat! (v1.48f) Personal Reply-To: David Xu Organization: Viasoft X-Priority: 3 (Normal) Message-ID: <14428093656.20010307163807@viasoft.com.cn> To: "Crist J. Clark" Cc: "Jerry Y. Wang" , cjclark@alum.mit.edu, freebsd-questions@FreeBSD.ORG Subject: Re[2]: Redirecting stderr to syslog ... In-reply-To: <20010307000552.I1367@cjc-desktop.users.reflexcom.com> References: <3AA52914.EB033F18@journalstar.com> <20010306231007.A36586@dragon.jerrywang.dyndns.org> <20010307000552.I1367@cjc-desktop.users.reflexcom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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: >> > 2>&1 >> > >> > The Hermit Hacker wrote: >> > > >> > > If I want to redirect stderr to a file, in tcsh, I do: >> > > >> > > >& >> > > >> > > If I want to redirect stdout to syslog, I do: >> > > >> > > | logger -p >> > > >> > > 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