See my answer here. Basically, you can't put single quotes inside single quotes - but you don't have to, because quotation marks aren't word delimiters, so you can step out of quotes, with a close ', add a literal single quote now that you're outside of the quotes with \', and then go back into quotes with a new open ', all without terminating the current shell word.