I'm having a problem with executing a shell command whose argument is a filename which may have single quotes, double quotes, or white spaces. Spcecifically, I need to execute the following command from a PHP script:
xmms-shell -e "load 'filepath'"
The problem is that if filepath contains a single or double quote, then the shell interpreter thinks its the end of the argument. Is there a way to escape the quotes to avoid this problem?