sh: test: argument expected and /etc/passwd

Mike Rovner mrovner at propel.com
Fri Nov 5 16:23:55 EST 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
PATH=~/bin:$PATH
ln -s /usr/bin/bash ~/sh

and try to run your script again from there.

HTH,
Mike





More information about the Python-list mailing list