Use the safer Bash built-in `[[` instead of `[`

Based on <http://mywiki.wooledge.org/BashGuide/Practices#Bash_Tests>.