I cannot remark on pip specifically, but some
script interpreters seem to ignore the shebang line if the script
is passed as an argument:
$ cat /tmp/blah.sh
#!/bin/bash
printf( "%s:%d\n", __FILE__, __LINE__ );
$ /tmp/blah.sh
/tmp/blah.sh: line 2: syntax error near unexpected token
`"%s:%d\n",'
/tmp/blah.sh: line 2: `printf( "%s:%d\n", __FILE__, __LINE__
);'
$ perl /tmp/blah.sh
/tmp/blah.sh: line 2: syntax error near unexpected token
`"%s:%d\n",'
/tmp/blah.sh: line 2: `printf( "%s:%d\n", __FILE__, __LINE__
);'
>From the above it's apparent that perl (without extra args) obeys
the shebang line; ditto for ruby (example omitted). This next
example demonstrates that bash (versions 3.2 and 4.3.33) does
not:
$ cat /tmp/stuff.sh
#!/usr/bin/perl
printf( "%s:%d\n", __FILE__, __LINE__ );
$ /tmp/stuff.sh
/tmp/stuff.sh:2
$ bash /tmp/stuff.sh
/tmp/stuff.sh: line 2: syntax error near unexpected token
`"%s:%d\n",'
/tmp/stuff.sh: line 2: `printf( "%s:%d\n", __FILE__, __LINE__
);'
I've omitted the text, but I ran the same test with sh, csh, tcsh,
zsh and python.
In summary, when the script is passed as an argument to
interpreter:
obeyed shebang: perl, ruby
ignored shebang: sh, csh, tcsh, zsh, bash, python
-brian