title: Print lines from match until end of file with awk
body: <p>In <a href="https://stackoverflow.com/q/3434462/1983854">Print lines in file from the match line until end of file</a> I learnt that you can use <code>0</code> in range expressions in <code>awk</code> to match until the end of the file:</p>
  
  <pre><code>awk '/matched/,0' file
  </code></pre>
  
  <p>However, today I started playing around this <code>0</code> and I found that this also works:</p>
  
  <pre><code>awk '/matched/,/!./' file
  </code></pre>
  
  <p>I guess <code>0</code> is working because in the range expression <code>/regex1/,/regex2/</code> the lines are printed until the <code>regex2</code> evaluates as True. And since <code>0</code> evaluates as False, this never happens and it ends up printing all the lines. Is this right?</p>
  
  <p>However, with <code>/!./</code> I would imagine this to work until a line without any character is found, like if we said <code>awk '/matched/,!NF'</code>. But it does not: instead, it always evaluates to False. What is the reasons for this?</p>
  
  <h3>Examples</h3>
  
  <pre><code>$ cat a
  1
  matched
  2
  
  3
  4
  end
  </code></pre>
  
  <p>Both <code>awk '/matched/,/!./' a</code> and <code>awk '/matched/,0' a</code> return:</p>
  
  <pre><code>matched
  2
  
  3
  4
  end
  </code></pre>
  
  <p>Whereas <code>awk '/matched/,!NF' a</code> returns:</p>
  
  <pre>
  matched
  2
  
  </pre>