I have a shell script that needs to run a python script. The python script may be passed an argument.
python pgm32.py $args
But when the argument passed has an escape sequence or if I encase it in quotes, the python scripts does not recognize it.
For instance say args contains "Open drive"
OR Open\ drive
then python script's sys.argv=['pgm32.py', '"Open', 'drive"']
OR sys.argv=['pgm32.py', '"Open', 'drive"']
respectively.
But when I call the python script directly from the command line, and pass an argument like "Open drive"
or Open\ drive
, the script's sys.arv=['pgm32.py', 'Open drive']
How can I fix this issue?