From 12f95885ba3f6d402499359337997e5c942c2df7 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Fri, 11 Dec 2020 00:12:58 -0800 Subject: [PATCH] Updated SC1066 (markdown) --- SC1066.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/SC1066.md b/SC1066.md index 5b9754b..57d69ff 100644 --- a/SC1066.md +++ b/SC1066.md @@ -20,10 +20,19 @@ declare "$name=hello world" echo "$foo" ``` +Or if you actually wanted to compare the value, use a test expression: + +```sh +if [ "$greeting" = "hello world" ] +then + echo "Programmer, I presume?" +fi +``` + ### Rationale: Unlike Perl or PHP, `$` is not used when assigning to a variable. ### Exceptions -None +If you wanted to