title: How can I escape characters in SQLite via bash shell?
body: <p>I am trying to send a query to SQLite from the command line using bash. I need to escape both single quotes and double quotes, and escape them so that bash does not misinterpret them. Here is a typical query:</p>
  
  <pre><code>select * from contacts where source = "Nancy's notes";
  </code></pre>
  
  <p>How can I send this query from the command line? The basic syntax is something like this:</p>
  
  <pre><code>sqlite3.bin contacts.db 'select * from contacts where source = "Nancy's notes"'
  </code></pre>
  
  <p>But in this case, the shell misinterprets either the single or double quotes. I've tried escaping using both double and triple slashes but this doesn't work. I'm befuddled. Any suggestions?</p>