I have the shell script where I create a Python file on the fly:
#!/bin/bash
args=("$@")
GIT_PASSWORD=${args[0]}
export $GIT_PASSWORD
python - << EOF
import os
print(os.environ.get("GIT_PASSWORD"))
EOF
echo $GIT_PASSWORD
echo "Back to bash"
I want to be able to access the variable GIT_PASSWORD, but unfortunately, I am not able to pass it to the python file.
Does anyone know what I am doing wrong and how I may fix that?
export $GIT_PASSWORDIf the password is ABC, then this becomesexport ABCexport GIT_PASSWORD