I have a large number of PDF's with the ISBN number in the filename (and therefore a number of books in my Calibre library that also have the ISBN in the title).

I was wondering if anyone had come up with either a bash script or a SQL query that would read for ISBN in the title field and then automagically drop the ISBN into the ISBN field and hit ISBNDB for the social metadata?

Use {isbn} in the regex Add field of Prefs|Import/Export|"Adding Books" to import the isbn from the file name. Turn off "Read metadata from file contents", import all your books, highlight them and fetch the metadata in bulk.