From 25b1332d57b5991df38e8b462a2777ddd563daea Mon Sep 17 00:00:00 2001 From: koalaman Date: Sat, 24 Sep 2016 15:11:04 -0700 Subject: [PATCH] Updated SC2055 (markdown) --- SC2055.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SC2055.md b/SC2055.md index c689fea..f02a56a 100644 --- a/SC2055.md +++ b/SC2055.md @@ -22,13 +22,13 @@ fi This is not a bash issue, but a simple, common logical mistake applicable to all languages. -`[[ $1 != foo || $1 != bar ]]` is always true: +`[[ $1 != foo || $1 != bar ]]` is always true (when `foo != bar`): * If `$1 = foo` then `$1 != bar` is true, so the statement is true. * If `$1 = bar` then `$1 != foo` is true, so the statement is true. * If `$1 = cow` then `$1 != foo` is true, so the statement is true. -`[[ $1 != foo && $1 != bar ]]` matches when `$1` is not `foo` and not `bar`: +`[[ $1 != foo && $1 != bar ]]` matches when `$1` is neither `foo` nor `bar`: * If `$1 = foo`, then `$1 != foo` is false, so the statement is false. * If `$1 = bar`, then `$1 != bar` is false, so the statement is false. @@ -38,4 +38,4 @@ This statement is identical to `! [[ $1 = foo || $1 = bar ]]`, which also works ### Exceptions -None. +Rare. \ No newline at end of file