sh: test: argument expected and /usr/bin/env

Iván Cabria cabria at
Tue Nov 9 16:16:10 CET 2004

in the help page of env (man env) we can find:   
     If env executes commands with arguments, it uses the default   
     shell /usr/bin/sh (see sh(1)).   
The first line of the python script I am running is:   
#!/usr/bin/env python  
and hence, is using the shell sh...   
To change this I have written in the first line of the script:  
#!/usr/bin/env SHELL=/bin/bash python  
I have run the script and there has not been any kind of output,  
after running a long time. The script is running, there are no error messages  
of the type 'sh: test: argument expected', but there is no output. It seems  
to me that Python is not running the script. In fact, I have written a  
print statement in the second line, and the script has not printed out  
the message. 
Without SHELL=/bin/bash in the first line, Python is running the script: I  
have written print statements in the second line of the script and also before 
and after the line where the error message comes from, and the script has 
printed out all the messages. 

More information about the Python-list mailing list