title: How do I pair every two lines of a text file with Bash?
body: <p>With a simple bash script I generate a text file with many lines like this:</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>192.168.1.1
  hostname1
  192.168.1.2
  hostname2
  192.168.1.3
  hostname3
  </code></pre>
  
  <p>Now I want to reformat this file so it looks like this:</p>
  
  <pre class="lang-none prettyprint-override"><code>192.168.1.1 hostname1
  192.168.1.2 hostname2
  192.168.1.3 hostname3
  </code></pre>
  
  <p>How would I reformat it this way? Perhaps <code>sed</code>?</p>