How to show drupal error messages in batch scripts? I'm using a few scripts for one-time data checking and scrubbing. They load the Drupal bootstrap but not the UI:

require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);


How can I display any error messages that they generate?
You should really be using Drush.  It handles bootstrapping and reporting error messages, etc.  In particular, the command drush php-script will be useful to you.

$ cd /path/to/drupal/sites/mysite
$ drush php-script /path/myscript.php


Write your script as usual.  Drush will bootstrap for you, so you may simply start calling Drupal APIs.  Any error messages generated will be printed to stderr.  See the readme file, http://drush.org, and  drush topic for all sorts of advice on getting started.