I am trying to pass two directories to my python script which just prints out the directory. But somehow its not working. Below is the code
shellscript.sh:
set VAR1=$(pwd)
echo $VAR1
set VAR2=$(pwd)
echo VAR2
python.exe mypython_script.py "$VAR1" "$VAR2"
mypython_script.py:
import os
import sys
if __name__ = '__main__':
print(sys.argv[1])
print(sys.argv[2])
The echo is printing the path, but the terminal also does print the script call line. There its showing python.exe mypython_script.py '' '' and then print statements are printing empty string. Could anyone point out to me where the problem is? Thank you
setcommand. So you should haveVAR1=$(pwd).pythonno.exeand then getting rid ofsetas was suggested, so just make itpythonand then nosetand it should run fine.