Fix up the 'namcap' shell script.

This makes the script more idiomatic and allows it to handle files with
spaces in their names.