Your problem is that you are invoking sh and not bash for your script in the shebang line. The syntactical convention of <(command) is a bashism that does not exist when invoked via sh, which emulates the Bourne ShellPOSIX shell (if /bin/sh is a symlink to /bin/bash).