sh: test: argument expected and /etc/passwd

Mike Rovner mrovner at
Fri Nov 5 22:23:55 CET 2004

Iván Cabria wrote:
> Hi,  
> thanks to Mike Rovner for the answer.  
> I did grep loginname /etc/passwd to confirm I was using bash, and the line I 
> got ended with 
> :/usr/bin/bash 

If the error doesn't go away try to locate shell invocation inside script.

Also try "which sh" and "ls -l $(which sh)". On my system that points to 
bash as well. If it isn't on yours, you can simulate it (if python 
script doesn't call sh bu full path like /bin/sh) by placing "sh" 
symlink to /usr/bin/bash early in your PATH:

mkdir ~/bin
ln -s /usr/bin/bash ~/sh

and try to run your script again from there.


More information about the Python-list mailing list