title: how to use awk to do a number comparisons and create a list - using Awk on macOS with CRLF line endings
body: <p>I'm trying to list values greater than my value listed (output from my <code>knife</code> command). I am trying to do this using <code>awk</code>, i've been researching examples and came up with this. However, my expected output does not work.</p>
  
  <p>For example with this command, I get the following output:</p>
  
  <pre><code>knife ssh -x foobar -a ec2.local_ipv4 "chef_environment:prod AND roles:db_cluster AND AND ipaddress:10.1.*" 'netstat -na | grep EST | wc -l'
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>10.1.3.129 2273
  10.1.3.130 2533
  10.1.3.131 1981
  10.1.2.133 1965
  </code></pre>
  
  <p>Now, I want to use <code>awk</code> because I want to filter only those values (2nd column, remove IPs) > 2000.</p>
  
  <p>I tried the following <code>awk</code> statement, but to no avail</p>
  
  <pre><code>knife ssh -x foobar -a ec2.local_ipv4 "chef_environment:prod AND roles:db_cluster AND AND ipaddress:10.1.*" 'netstat -na | grep EST | wc -l' \
  | awk '{if ($2 &gt; 2000) print $2; else echo "Nothing to print"}`
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>10.1.3.129 2273
  10.1.3.130 2533
  10.1.3.131 1981
  10.1.2.133 1965
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>2273
  2533
  </code></pre>