diff --git a/SC1029.md b/SC1029.md new file mode 100644 index 0000000..def9a7f --- /dev/null +++ b/SC1029.md @@ -0,0 +1,21 @@ +## In `[[..]]` you shouldn't escape `(` or `)`. + +### Problematic code: + +```sh +[[ -e ~/.bashrc -a \( -x /bin/dash -o -x /bin/ash \) ]] +``` + +### Correct code: + +```sh +[[ -e ~/.bashrc -a ( -x /bin/dash -o -x /bin/ash ) ]] +``` + +### Rationale: + +You don't have to -- and can't -- escape `(` or `)` inside a `[[ .. ]]` expression like you do in `[ .. ]`. Just remove the escaping. + +### Exceptions: + +None. \ No newline at end of file