Re: Getting process error info

From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 04/29/04


Date: Thu, 29 Apr 2004 12:25:20 -0400

In article <9fe1f2ad.0404290743.32c6300a@posting.google.com>,
 laredotornado@zipmail.com (D. Alvarado) wrote:

> Hi, I'm rather a novice to shell scripting, but I'm using /bin/sh, and
> I'm trying to record the success of a process I run and then any error
> message produced when the processes crashes. If it's useful, the
> process I'm running is
>
> java org.apache.xalan.xslt.Process -in $XML_INPUT_FILE -out
> $XML_OUTPUT_FILE -xsl liml2html.xsl -xml
>
> What is the recommended way of saving out success and/or error
> information? Thanks, - Dave

The variable $? contains the exit status of the last process; normally,
any value other than 0 indicates that it exited due to an error.

You can save the error messages by redirecting standard error:

<command> 2>errors.out

will run <command> with standard error put in the file errors.out.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***