Hello. In section “3.2.4.2 Conditional Constructs” of Bash docs (both in ‘man’ and in the web), at the end, there is an explanation on combining expressions, starting with the use of brackets.
There it would be worth to mention that: 1. you must escape the brackets, also inside script files 2. you have to leave blank/s between the brackets and the expression itself Point 2 could be inferred merely from the way it's written in the docs., but I don't think it's clear that brackets should be escaped. It took me quite a while and a lot of fumbling to realize that. The rest of operators in this section, like ! or && don't need to be quoted; not even !, which is suspicious of having a different meaning for the shell. I don't know what makes brackets special in this sense, but I guess it should be mentioned. -- Juanma Menéndez