Bash Script shebang


  • Use /bin/bash as the bash interpreter:


  • Search the bash interpreter in the PATH environment variable with envexecutable:

    #!/usr/bin/env bash


A common mistake is to try to execute Windows end-line formatted \r\n script files on UNIX/Linux systems, in this case the used script interpreter in the shebang is:


And is obliviously not found but can be hard to figure out.