Script now handles filenames with special characters (such as spaces, hard tabs, newlines, double quotes and a dash prefix). The only exceptions are filenames with single quotes. In this case, the script will fail early with a clear error message.
On FreeBSD and Solaris, Bash isn't by default located in /bin. This shebang line will find it according the environment path.