incron, inotify, filewatcher[2], puncher[3], guard[4] are a bunch of existing ones, but they're all either not entirely functional cross-platform, or require some faffing with dependencies to get working.
[1] https://code.google.com/p/simplefilewatcher/
[2] https://github.com/thomasfl/filewatcher
[3] http://rawsyntax.com/blog/puncher-the-simple-file-watcher-fo...
You could even say that using bash as /bin/sh "is specific to Linux."
How to fix: /#!\/bin\/bash/s/bash/sh/