sh: test: argument expected

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Iván Cabria

    #1

    sh: test: argument expected

    Hi,

    I have run the script using "python scriptname.py" and the error does
    not go away. I got the same error:

    sh: test: argument expected


    I have checked again that the first line of the python script is
    #!/usr/bin/env python

    There are no blank lines or empty spaces before
    #!/usr/bin/env python


    I also did "grep loginname /etc/passwd" to confirm I was using bash, and the
    line I got ended with

    :/usr/bin/bash




    Iván


  • Steve Holden

    #2
    Re: sh: test: argument expected

    Iván Cabria wrote:
    [color=blue]
    > Hi,
    >
    > I have run the script using "python scriptname.py" and the error does
    > not go away. I got the same error:
    >
    > sh: test: argument expected
    >
    >
    > I have checked again that the first line of the python script is
    > #!/usr/bin/env python
    >
    > There are no blank lines or empty spaces before
    > #!/usr/bin/env python
    >
    >
    > I also did "grep loginname /etc/passwd" to confirm I was using bash, and the
    > line I got ended with
    >
    > :/usr/bin/bash
    >[/color]

    That's as may be, but I can't escape the conclusion that your script is
    involving the shell somehow - maybe the GetPotentialEne rgy() method
    calls os.system() or some other piece of functionality.

    About all I can say is that the error message you are seeing is
    definitely NOT from the Python interpreter. Try putting a print
    statement of some kinf as the second loine of your script and make sure
    that Python is actually running that script. If it is, you'll need to
    find out where it's calling shell functionality.

    regards
    Steve
    --


    Holden Web LLC +1 800 494 3119

    Comment

    Working...