title: Is there a difference between negating before/after a test command?
body: <p>I've been Bash scripting for a while and I'm wondering if there's any difference between these two forms of negation with the <code>test</code> command:</p>
  
  <pre><code>if [ ! condition ]; then
  fi
  
  if ! [ condition ]; then
  fi
  </code></pre>
  
  <p>The first tells the shell to pass the arguments <code>! condition</code> to test, letting the program take care of the negation itself. On the other hand, the second passes <code>condition</code> to test and lets the shell itself negate the error code.</p>
  
  <p>Are there any pitfalls I should be aware of when choosing between these two forms? What values of <code>$condition</code> could make the results differ between them?</p>
  
  <p>(I seem to remember reading an article a while ago discussing this, but I don't remember how to find it/exactly what was discussed.)</p>