2

I have a python script that logs me in to a service. I do:

./login.py [email protected] 'pass'

in order to log in.

When I enter this command directly I successfully login. When I run the following script server returns 400.

PYAPIROOT="scriptpath/script"
PYLOGIN="./login.py"
LOGIN="[email protected]"
PASS="'pass'"

function login {
    echo -----------------------------
    echo
    cd $PYAPIROOT
    echo "Logging in "$LOGIN
    python "$PYLOGIN" "$LOGIN" "$PASS"
    echo $PYLOGIN $LOGIN $PASS
    echo -----------------------------
}

login

When I copy and run what is echo'ed I get 200. Why can't I log in using my script?

0

1 Answer 1

1

I suspect it's the double-quoting:

PASS="'pass'"

Use this instead:

PASS="pass"
Sign up to request clarification or add additional context in comments.

2 Comments

@Booyaches OK that's good then. How about upvoting and accepting the answer then?
Sure. I had to wait 15 mins from when the question was asked to accept any answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.