title: pipe output of cut and echo to same line in file
body: <p>I have a bash script that uses grep and cut to send data into an output file. What I haven't been able to achieve is to echo a counter to the same line, in the file, as the output of cut.</p>
  
  <p>This is what I've tried:</p>
  
  <pre><code>{ echo -n "B " &amp; input_file.dat | grep -i "Total net con" | cut -d' ' -f10,12; } &gt;&gt; output_file.dat
  </code></pre>
  
  <p>What I get in <code>output_file.dat</code> is something like:</p>
  
  <pre><code>B result_from_grep_and_cut_1
  result_from_grep_and_cut_2
  result_from_grep_and_cut_3
  ...
  </code></pre>
  
  <p>As you can see <code>B</code> is present in the first line only. What I am trying to do is to get <code>B</code> at the beginning of each line. How can i do this?</p>
  
  <p>Thanks for your help.</p>