Date: Fri, 25 Jun 1999 09:23:18 -0700 From: "Scott Worthington" <SWorthington@hsag.com> To: <ru@ucb.crimea.ua> Cc: <freebsd-questions@FreeBSD.ORG>, <wmptl@MNSi.Net> Subject: Re: cron difficulties Message-ID: <s7734a9c.091@internal.hsag.com>
next in thread | raw e-mail | index | archive | help
Ruslan Ermilov <ru@ucb.crimea.ua> 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 <ru@ucb.crimea.ua> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?s7734a9c.091>