What is the difference between single and double square brackets in Bash?
Single [] are posix shell compliant condition tests. Double [[]] are an extension to the standard [] and are supported by bash and other shells (e.g. zsh, ksh). They support extra operations (as well as the standard posix operations). For example: || instead of -o and regex matching with =~. A fuller list of differences … Read more