unfortunately, ``sed -r`` is ``-E`` on Mac OS X. http://superuser.com/questions/231704/list-all-unique-extensions-for-files-contained-in-a-directory#comment237453_232101 Not sure if you want to fix it, just thought I'd mention that this won't work on Mac.