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

Iván Cabria cabria at fta.uva.es
Tue Nov 9 16:16:10 EST 2004


Hi, 
  
in the help page of env (man env) we can find:   
..   
..   
  /usr/bin/env   
     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. 
 
 
 
Iván 





More information about the Python-list mailing list