From c5006cfd4f18f24e236ca6bbee3accef94a9a370 Mon Sep 17 00:00:00 2001 From: Beathan Andersen Date: Wed, 16 Oct 2019 13:52:50 -0500 Subject: [PATCH] fix if regex match The regex string should not have any quotes around it. To validate test: $ if [[ "A" =~ . ]]; then echo pass; else echo fail; fi with and without quotes --- bash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash.md b/bash.md index 158b6a31f..0825fc323 100644 --- a/bash.md +++ b/bash.md @@ -424,7 +424,7 @@ if [[ "$A" == "$B" ]] ```bash # Regex -if [[ "A" =~ "." ]] +if [[ "A" =~ . ]] ``` ```bash