Vielleicht funktioniert das Skript nur vernünftig mit bash, ändere mal die 1. Zeile zu...
Code:
#!/usr/bin/env bash