title: comparing consecutive rows in awk
body: <p>I would like to compare consecutive rows in a file using awk command. Here is an example of input and output.</p>
  
  <p>Input file</p>
  
  <pre><code>6    
  7    
  8    
  9    
  10    
  4    
  5    
  6
  </code></pre>
  
  <p>The output file I wanted to have is like this:</p>
  
  <pre><code>6
  7
  8
  9
  10 
  14 
  15 
  16  
  </code></pre>
  
  <p>Basically I wanted to compare if the current line is greater than the previous one and continue to print both the previous and the current lines. As soon as the current line is less than the previous one, add a value (10) to each of the subsequent lines.</p>