I'm considering writing a script which (among other things) can iterate through all the valid revisions for an element. I'm trying to figure out the best way to do that. I could easily just start at "1" up to the latest revision number, and just check for errors on each one, but that seems pretty painful. Is there a straightforward way to get a list of valid revision numbers for an element? I would like the ability to start at the beginning and iterate to the latest, and also start at the latest and iterate to the earliest.
This would be done in a Bash or Perl script.