Possible Duplicate:
Python module to shellquote/unshellquote?
I am trying to pass a string's value into a command as input, in Python for executing a bash command. I currently have somthing like this:
cmd = 'echo ' + <StringValue> + ' | command'
output = commands.getOutput(cmd)
but it does not work because my string value also contains both " and ', so it parses them wrong. Can anyone please tell me how I can pass this?