title: In Linux shell bash script, how to print to a file at the same line?
body: <p>In Linux shell bash script, how to print to a file at the same line ? </p>
  
  <p>At each iteration, </p>
  
  <p>I used</p>
  
  <pre><code> echo "$variable1"  &gt;&gt; file_name, 
  
   echo "$variable2"  &gt;&gt; file_name, 
  </code></pre>
  
  <p>but echo insert a newline so that it becomes</p>
  
  <pre><code> $v1
  
   $v2 
  </code></pre>
  
  <p>not </p>
  
  <pre><code>     $v1 \tab  $v2
  </code></pre>
  
  <p>"\c" cannot eat newline. </p>
  
  <p>this post 
  <a href="https://stackoverflow.com/questions/8228807/bash-shell-script-echo-to-output-on-same-line">BASH shell script echo to output on same line</a></p>
  
  <p>does not help .</p>
  
  <p>thanks</p>