title: insert email into sqlite field, in awk script
body: <p>I am inserting <strong>email</strong> into <strong>SQlite</strong> table field, in <code>awk</code> using:</p>
  
  <pre><code>system("sqlite3 database.db " sprintf("\"UPDATE tbl SET email = '&lt;a href=\\\"mailto:%s\\\"&gt;%s&lt;/a&gt;' WHERE field = '%s'\", m[1], m[1], l))"))
  </code></pre>
  
  <p>After that when using <code>SELECT</code> query from bash:</p>
  
  <pre><code>function do_query() {
  
      sqlite3 -batch database.db &lt;&lt;- "end_of_message"
          #...
          #...
          #.. outputs to "o.html"
  
          select field1,email,field3 from tbl; # &lt;-- HERE IS THE SELECT
              QUERY FOR THAT EMAIL FIELD
      end_of_message
      #...
      #... here just embedding output of this into my template file
      #... which is some simple HTML
  
      sed -e '
      /\${template_tag}/ {
          r o.html &lt;--output from sqlite3 select statement
          d
      }
      ' template.html &gt; out.html
  
  }
  </code></pre>
  
  <p>,rendering this in browser I am getting this <strong>literally</strong>:</p>
  
  <pre><code>&lt;a href="mailto:worldnamegroup@gmail.com"&gt;worldnamegroup@gmail.com&lt;/a&gt;
  </code></pre>
  
  <p>,instead of <code>worldnamegroup@gmail.com</code> as a <code>clickto</code> mail link.</p>
  
  <p>So in my <code>source view</code> in browser I see this:</p>
  
  <pre><code>&amp;lt;a href=&amp;quot;mailto:worldnamegroup@gmail.com&amp;quot;&amp;gt;worldnamegroup@gmail.com&amp;lt;/a&amp;gt;
  </code></pre>
  
  <p><code>&lt;</code> and <code>&gt;</code> are being converted into <code>&amp;lt;</code> and <code>&amp;gt;</code> respectively.</p>
  
  <p>How to insert that <code>email</code> so that I have in my browser properly rendered email
  link?</p>
  
  <p><strong>edit 1</strong>
  It's also strange I get other output ok from that select, like <code>&lt;td&gt;</code> for
  example. But that's done internally by <strong>sqlite</strong> when <code>.mode</code> set to <code>html</code>.</p>
  
  <p><strong>edit 2</strong>
  I found that the real problem may be in sqlite mode option. When set <code>.mode
  column</code>, it shows all well in terminal, but when <code>.mode html</code>, it shows:</p>
  
  <pre><code>&lt;TD&gt;&amp;lt;a href=&amp;quot;mailto:worldnamegroup@gmail.com&amp;quot;&amp;gt;worldnamegroup@gmail.com&amp;lt;/a&amp;gt;&lt;/TD&gt;
  </code></pre>
  
  <p><strong>edit 3</strong>
  Until someone comes up with something smarter, I made a workaround like this:</p>
  
  <pre><code>cat o.html |recode html..ascii
  </code></pre>
  
  <p>,then used the output of that, to feed my <code>template</code>.</p>