Comment Comment by fooblat Alternatively you can use the newer (and highly recommended) bash syntax that is also quote safe: $ a=1; b=1; c='!'; d='!' $ [[ $a = $b && $c = $d ]] && echo true true For anyone writing bash scripts today I would avoid the old test/[ functions entirely. parent fooblat 5 years ago