title: Bash while sed is not null
body: <p>I need to do while loop when sed is not null. Example:</p>
  
  <p>File 1</p>
  
  <pre><code>line1
  line2
  line3
  </code></pre>
  
  <p>File 2</p>
  
  <pre><code>i=1
  
  while sed "${int}p" # here I need expression which checks if line is not null
  # here echo this line and i++
  </code></pre>
  
  <p>I tried to write just <code>while sed -n "${int}p"</code> but it does not work as I expected.</p>