I have a script that takes a MySQL SELECT query as its sole argument. Typically I enclose that query in single quotes and use double quotes within the query for enclosing the strings that are arguments of the query itself.
Occasionally this presents a problem, usually when the query itself must search for quote characters (single or double). I'm sure this can be resolved by properly escaping the single and double-quotes, but this is tricky since MySQL and the Linux shell may use different methods for escaping.
Example... here's an example, and it seems incredibly difficult to me... it needs to find single-quote characters that are preceded by a backslash. Note, this example does not intend to escape any characters for either MySQL or the CLI. The percent symbols act as wildcards in MySQL.
./show-results 'SELECT * FROM `table` WHERE `column` LIKE "%\'%"'
Is it possible to use something other than single or double-quotes to enclose a shell argument?