I have the following command
cmd '"asdf" "a'sdf"'
I need to surround the arguments with single quotes only. cmd doesnt work with double quotes for some reason I dont know. The above command doesnt work because the single in the middle terminates the first single quote. If I escape, to the following
cmd '"asdf" "a\'sdf"'
It still doesnt work. How do I get this working?
According to the bash man page:
So the answer is, you can’t include a single quote within a single-quoted string no matter how you try. But depending on how your script is set up you may be able to use
'\'', which will end the first single quote, escape the second, and start another single-quoted string with the third.