title: awk after grep: print value when grep returns nothing
body: <p>I have a question when I use awk and grep to parse log files.
  The log file contains some strings with figures, e.g.</p>
  
  <pre><code>Amount: 20
  Amount: 30.1
  </code></pre>
  
  <p>And I use grep to parse the lines with keyword "Amount", and then use awk to get the amount and do a sum:</p>
  
  <p>the command is like:</p>
  
  <p><code>cat mylog.log | grep Amount | awk -F 'Amount: ' '{sum+=$2}END{print sum}'</code> </p>
  
  <p>It works fine for me. However, sometimes the mylog.log file does not contains the keyword 'Amount'. In this case, I want to print 0, but the above awk command will print nothing. How can I make awk print something when grep returns nothing? </p>