title: AWK: append text to specific line with 'system(external programm)' substitution
body: <p>I have a file called <code>data</code> that looks like this:</p>
  <pre><code>orange
  apple
  pair
  mango
  grape
  </code></pre>
  <p>by using
  <code>awk -i inplace '{if (NR==4) $0=$0&quot; is sweet&quot;}{print}' data</code>, I get:</p>
  <pre><code>orange
  apple
  pair
  mango is sweet
  grape
  </code></pre>
  <p>I'm trying to achieve the same result through <code>system()</code> but I can't figure out how.</p>
  <pre><code>echo is sweet | xclip
  </code></pre>
  <p><code>xclip -o</code> outputs <code>is sweet</code>. I'm trying</p>
  <pre><code>awk -i inplace '{if (NR==4) $0=$0(system(&quot;xclip -o&quot;))}{print}' data
  </code></pre>
  <p>and <code>cat -n data</code> gives me</p>
  <pre><code>     1  orange
       2  apple
       3  pair
       4  is sweet
       5  mango0
       6  grape
  </code></pre>
  <p>Mango and grape have been pushed down one line, <code>is sweet</code> is on its own on line 4 and <code>mango</code> has a <code>0</code> in the end.</p>
  <p>How can I change the command, and still use <code>system(&quot;xclip -o&quot;)</code> so that line 4 says <code>mango is sweet</code>, no appended <code>0</code> anywhere and no extra line, i.e. as with the first example?</p>
  <p>I've super new with awk, and any help would be greatly appreciated.</p>