Date: Thu, 21 Apr 2011 09:36:09 +0200 From: Riaan Kruger <riaank@gmail.com> To: freebsd-questions@freebsd.org Subject: Re: redirecting command output depending on exit status Message-ID: <BANLkTinw=F9SFXUZBFvOUa7mNHdWBDYw8A@mail.gmail.com> In-Reply-To: <20110420130106.GA30295@ei.bzerk.org> References: <4DAD9594.8030108@cyanide-studio.com> <20110420130106.GA30295@ei.bzerk.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> > > I have a cron task set up using lockf. > > > > I'd like to redirect one exit status to /dev/null : > I think that the exit status of a command will be after any output of the command to stderr or stdout. So first it will say "This is wrong" and then it will exit giving you the exit code. The only thing I can think of is to write a wrapper script which in effect parses out the error message for example: command | grep -v "offending message" > logfile Regards Riaan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTinw=F9SFXUZBFvOUa7mNHdWBDYw8A>