Compact for {...} iterator to allow it to run on Mac OSX, fixes #1

Another option would be to use straight [array iteration](http://www.cyberciti.biz/faq/bash-for-loop-array/) and parsing the filename, rather than using two loops.