title: Linkify text file in Linux
body: <p>I have parsed all rows containing urls from a text file and appended line breaks, and I want to make the links clickable in a new file.</p>
  <p>How do I append <code>&lt;a href&gt;</code> -tags around only the urls, using standard linux tools, preferably awk?
  It needs to be automatable in cron.</p>
  <p>For example,</p>
  <p>source file <strong>chaturls.txt</strong>:</p>
  <pre><code>    12:30 &lt;user&gt; check this: https://link.to/stuff.jpg&lt;/br&gt;
      13:47 &lt;user4&gt; https://another.link.lol eyyyy&lt;/br&gt;
  </code></pre>
  <p>desired output in new file, <strong>chatlinkified.html</strong>:</p>
  <pre><code>12:30 &lt;user&gt; check this: &lt;a href='https://link.to/stuff.jpg'&gt;https://link.to/stuff.jpg&lt;/a&gt;&lt;/br&gt;
  13:47 &lt;user4&gt; &lt;a href='https://another.link.lol'&gt;https://another.link.lol&lt;/a&gt; eyyyy&lt;/br&gt;
  </code></pre>
  <p>I tried <code>awk '{printf &quot;&lt;a href=\&quot;%s\&quot;&gt;%s&lt;/a&gt;&lt;br&gt;&quot;, $0,$0}' chaturls.txt &gt; chatlinkified.html</code>, but this makes the whole line an (invalid) clickable link.</p>