title: Bash scripting - if cases $? > 0
body: <p>Sorry for possible spam, I'm finishing RHEL Security Hardening/Auditing script, where I want an overall result in the end.
  For example,</p>
  
  <pre><code># PermitEmptyPasswords
  grep -E '^\s*PermitEmptyPasswords\s+no\s*' /etc/ssh/sshd_config &amp;&gt; /dev/null
  if [ $? = 0 ];
  then echo "[ OK ] PermitEmptyPasswords is properly configured";
  else echo "[ ERROR ] PermitEmptyPasswords is not properly configured";
  fi
  </code></pre>
  
  <p>Now, my idea for overall result (Safe/Not safe) is to make sum of all these if $? cases, if all cases give sum of 0, it will echo "This system is properly configured by hardening policy", else echo "This system has errors" + reprint all errors where $? is > 0.</p>
  
  <p>How to get this work? I'm new at scripting, so any help will be appreciable.
  Thanks in advance.</p>