[PLUG-TALK] Structuring .xml File

Rich Shepard rshepard at appl-ecosys.com
Tue Mar 1 15:21:32 PST 2011


On Tue, 1 Mar 2011, Paul Heinlein wrote:

> I'll note that tidy has a somewhat unusual set of return values, which
> will be of interest if you ever want to use tidy in a shell script:
>
>  0 = success
>  1 = there were warnings
>  2 = there were errors
>
> Since I can usually live with warnings (but not with errors), I script
> up tidy something like this:
>
>   /usr/bin/tidy [options and files]
>   RETVAL=$?
>   if test $RETVAL -lt 2; then
>     exit 0
>   else
>     exit $RETVAL
>   fi
>
> Otherwise, warnings (which have a non-zero return value) will cause
> ordinary shell scripts to abort.

   Good to know, Paul. Thank you.

   In my case it's easy to see the formatted xml file and determine it's
readable.

Rich



More information about the PLUG-talk mailing list