Hi -

I am using Xerces in a shell script (bash) on Linux and Mac OS X.
I want to detect if sax.Counter gets a parse error or a 'file not
found' error.  First, I tried this:

    java sax.Counter -v myfile.xml
    echo $?

When I check the value of $? in the shell script, it always comes
back 0, so I cannot use the value to detect an error.

I am currently doing this:

    java sax.Counter -v myfile.xml > stdout.txt 2> stderr.txt

My shell script checks the file size of stderr.txt.  If the file
size is greater than zero, then it contains error messages, so
I assume that sax.Counter has encountered an error and the script
takes appropriate action.

Is this the best way to handle this error, or is there a better way?

Thanks.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to