From 17f256db3d668a1ba08fbb770bb20221a0a8433c Mon Sep 17 00:00:00 2001 From: koalaman Date: Sat, 3 Jun 2017 11:44:36 -0700 Subject: [PATCH] Created SC1029 (markdown) --- SC1029.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SC1029.md 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