cat /tmp/testme
#!/usr/bin/env python3
import sys
print(sys.argv[0])
print(sys.argv[1])
It is simple ,just to print argument passed from bash to python.
x="i am a book"
/tmp/testme "i am a book"
/tmp/testme
i am a book
The string i am a book can passed into python program as a whole string.
/tmp/testme ${x}
/tmp/testme
i
echo ${x}
i am a book
Why python can't deal with ${x} i am a book as a whole,it get only the first character in the string as argument.
/tmp/testme "${x}"