From 1d098c420e7a9df220f43299f50be7d0626940c6 Mon Sep 17 00:00:00 2001 From: koalaman Date: Sat, 15 Aug 2015 22:18:46 -0700 Subject: [PATCH] Created SC2110 (markdown) --- SC2110.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 SC2110.md diff --git a/SC2110.md b/SC2110.md new file mode 100644 index 0000000..d2c85f8 --- /dev/null +++ b/SC2110.md @@ -0,0 +1,17 @@ +## "In [[..]], use || instead of -o. + +### Problematic code: + + [[ "$1" = "-v" -o "$1" = "-help" ]] + +### Correct code: + + [[ "$1" = "-v" || "$1" = "-help" ]] + +### Rationale: + +`-o` for logical OR is not supported in a `[[ .. ]]` expression. Use `||` instead. + +### Exceptions: + +None. \ No newline at end of file