From 3d839093e95dc82f6d71d1821dc411a6ec544eba Mon Sep 17 00:00:00 2001 From: Rajinder Yadav Date: Wed, 1 Apr 2020 07:44:50 -0400 Subject: [PATCH 1/2] Correct conditions, removed superfluous brackets --- bash.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bash.md b/bash.md index 001186ee6..c1a051f1e 100644 --- a/bash.md +++ b/bash.md @@ -368,8 +368,8 @@ Note that `[[` is actually a command/program that returns either `0` (true) or ` | `[[ -o noclobber ]]` | If OPTIONNAME is enabled | | --- | --- | | `[[ ! EXPR ]]` | Not | -| `[[ X ]] && [[ Y ]]` | And | -| `[[ X ]] || [[ Y ]]` | Or | +| `[[ X && Y ]]` | And | +| `[[ X || Y ]]` | Or | ### File conditions @@ -401,7 +401,7 @@ fi ```bash # Combinations -if [[ X ]] && [[ Y ]]; then +if [[ X && Y ]]; then ... fi ``` From d0381c2254d83afb6600073dbd966f1f69aa7a6a Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Sat, 13 Jun 2020 10:16:14 +1000 Subject: [PATCH 2/2] Update bash.md --- bash.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bash.md b/bash.md index c1a051f1e..c23453ee6 100644 --- a/bash.md +++ b/bash.md @@ -363,13 +363,15 @@ Note that `[[` is actually a command/program that returns either `0` (true) or ` | --- | --- | | `(( NUM < NUM ))` | Numeric conditions | -| Condition | Description | -| --- | --- | -| `[[ -o noclobber ]]` | If OPTIONNAME is enabled | -| --- | --- | -| `[[ ! EXPR ]]` | Not | -| `[[ X && Y ]]` | And | -| `[[ X || Y ]]` | Or | +#### More conditions + +| Condition | Description | +| -------------------- | ------------------------ | +| `[[ -o noclobber ]]` | If OPTIONNAME is enabled | +| --- | --- | +| `[[ ! EXPR ]]` | Not | +| `[[ X && Y ]]` | And | +| `[[ X || Y ]]` | Or | ### File conditions