This is not a mistake, and it has nothing to do with shebang, just an exclamation point.
Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, `, \, and, when history expansion is enabled, !.
So either avoid it, use single quotes, or disable the history extension.
eg.
> echo "How dare you put an '!' in this string?" bash: !: event not found > set +o histexpand > echo "How dare you put an '!' in this string?" How dare you put an '!' in this string?
Broslow
source share