title: escape single quote in shell variable
body: <p>I wrote a bash script to insert values to <code>sqlite</code> database. The command is as follow</p>
  
  <pre><code>sqlite3 ${db_name} "insert into ${table_name} (${column1},${column2}) values ('$f1','$f2');"
  </code></pre>
  
  <p>This command works fine until <code>f1</code> variable contains a single quote </p>
  
  <pre><code># e.g f1="I'm just kidding"
  # the command reported error
  Error: near "m": syntax error
  </code></pre>
  
  <p>May someone please show me how can we escape the single quote inside the variable?
  Any recommendations are appreciated. Thanks!</p>