scripts: use [...] form of `test` in conditionals