Here is my example shell script:
#!/bin/bash
#assuming this param is obtained from outside
cmd='-c "python test.py --log_level=info"'
#full cmd
docker run xxx $cmd
The expected command should be
docker run xxx -c "python test.py --log_level=info"
however, error occurs: test.py: -c: line 0: unexpected EOF while looking for matching `"'
So I run with 'sh -x' and here is output:
+ cmd='-c "python test.py --log_level=info"'
+ docker run xxx -c '"python' test.py '--log_level=info"'
The full cmd is not I wondered, can you help me to solve this? Big thanks :)