From 1dfacb674a4d3ccc47c0c67b90a2a24467e28a54 Mon Sep 17 00:00:00 2001 From: Antonio Riccio Date: Thu, 1 Aug 2019 11:06:56 +0100 Subject: [PATCH] Corrected the bash cheatsheet - modified the condition to verify if two values are identical --- languages/bash.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/languages/bash.sh b/languages/bash.sh index ea2606e..866968b 100644 --- a/languages/bash.sh +++ b/languages/bash.sh @@ -219,12 +219,12 @@ statement1 || statement2 # or operator # STRINGS -str1 = str2 # str1 matches str2 -str1 != str2 # str1 does not match str2 -str1 < str2 # str1 is less than str2 (alphabetically) -str1 > str2 # str1 is greater than str2 (alphabetically) --n str1 # str1 is not null (has length greater than 0) --z str1 # str1 is null (has length 0) +str1 == str2 # str1 matches str2 +str1 != str2 # str1 does not match str2 +str1 < str2 # str1 is less than str2 (alphabetically) +str1 > str2 # str1 is greater than str2 (alphabetically) +-n str1 # str1 is not null (has length greater than 0) +-z str1 # str1 is null (has length 0) # FILES @@ -411,7 +411,7 @@ function errtrap { echo "ERROR line $1: Command exited with status $es." } -trap 'errtrap $LINENO' ERR # is run whenever a command in the surrounding script or function exits with non-zero status +trap 'errtrap $LINENO' ERR # is run whenever a command in the surrounding script or function exits with non-zero status function dbgtrap { echo "badvar is $badvar"