Can you create a script to programatically run update.php on multiple drupal sites We have a multi-site install that uses the same core files but different databases.  As of right now, we have over 40 sites. When I do module and core upgrades, I have to login to each site and manually run update.php.

Is there a way to automate this process so that I do not have to spend so much time logging into every multisite, run update.php and clear the cache?  If so, what is the exact command to run update.php? I've tried wget and that doesn't seem to work.
I've written a similar script on a 50+ site multisite install. You want to use the command line powertool drush for this, and then run the command 

drush updb


from a shell script, ex:

cd /var/www/site1-environment/
drush updb --uri=http://site1.com 
cd /var/www/site2-environment/
drush updb --uri=http://site2.com 
... etc


Of course if all of these sites are in the same multi-site structure than you won't need to repeat the cd command in your shell script.