I have a strange bug with bash shebang: when I try to give twistd as interpreter, bash tries to execute the script as a shell script !

Here is a simple, not working, twisted script with a shebang:

1
2
#! /usr/bin/twistd -y
from twisted.application import internet, service

Bash execution:

$ bash -c ./test.tac
from: can't read /var/mail/twisted.application

Bash is trying to execute the script as a shell script ! (from is a shell command).

Zsh execution:

$ zsh -c ./test.tac
Failed to load application: 'application'

The error is correct (there is no application defined in the twisted script). It really looks like a bug in bash ..