calling Bash script in Python / missing shebang

I recently tried to call a „bash“ script (actually it just was rather a batch script with some commands) out of a python script:

subprocess.call("/home/tux/bin/foo.sh")

Unfortunately, it did not work:

OSError: [Errno 8] Exec format error

The problem was, that foo.sh missed the „shebang-line“

#!/bin/bash
[...]

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *