From owner-freebsd-questions Fri Jun 25 9:21:32 1999 Delivered-To: freebsd-questions@freebsd.org Received: from gate.hsag.com (gate.hsag.com [209.180.144.14]) by hub.freebsd.org (Postfix) with SMTP id CBA0A14F22 for ; Fri, 25 Jun 1999 09:21:29 -0700 (PDT) (envelope-from SWorthington@hsag.com) Received: (qmail 22089 invoked from network); 25 Jun 1999 16:12:40 -0000 Received: from unknown (HELO internal.hsag.com) (192.168.83.9) by 192.168.83.5 with SMTP; 25 Jun 1999 16:12:40 -0000 Received: from AZPRO-Message_Server by internal.hsag.com with Novell_GroupWise; Fri, 25 Jun 1999 09:23:40 -0700 Message-Id: X-Mailer: Novell GroupWise 5.5 Date: Fri, 25 Jun 1999 09:23:18 -0700 From: "Scott Worthington" To: Cc: , Subject: Re: cron difficulties Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Ruslan Ermilov indicated that his form of redirection for the 'cron difficulties' is better. Okay, why is it better? =20 The default distribution of FreeBSD uses the below mentioned form for cron'ing of the /etc/daily, /etc/weekly, and /etc/monthly shell scripts: nameofcommand 2>&1 > /dev/null Is the default distribution in error? It works. Does it not? And again, what makes this form, below, better? nameofcommand >/dev/null 2>&1 I am fairly new to shell programming, especially with regard to the power of Unix shells, so I feel compelled to learn more. Thanks. This is very interesting. >>> Ruslan Ermilov 1999-06-24 11:28:00 PM >>> >>On Thu, Jun 24, 1999 at 02:14:34PM -0700, Scott Worthington wrote: >>Alright, Nathan... I'm not sure that anyone has really helped you with >>your cron problem. >>=20 >> Here's what is going on (and how to solve the problem): >>=20 >> Your cron'ed software is generating output, there are two kinds: >> standard output >> standard error >>=20 >> This is controlled by your shell. To learn more, type 'man sh' >> Press the '/' key and type in standard error. >>=20 >> Okay, here's the problem with your cron: >> You are going to redirect the standard out AND standard error to the >> device null. >>=20 >> nameofcommand 2>&1 > /dev/null >>=20 >It's better to write ``nameofcommand >/dev/null 2>&1'' instead. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message