1
1
mirror of https://github.com/namibia/awesome-cheatsheets.git synced 2024-11-21 12:25:14 +00:00

Merge pull request #86 from artic92/bash-cheatsheet-correction

Corrected the bash cheatsheet
This commit is contained in:
Julien Le Coupanec 2019-08-03 15:00:41 +03:00 committed by GitHub
commit 81eae536b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,12 +219,12 @@ statement1 || statement2 # or operator
# STRINGS # STRINGS
str1 = str2 # str1 matches str2 str1 == str2 # str1 matches str2
str1 != str2 # str1 does not match str2 str1 != str2 # str1 does not match str2
str1 < str2 # str1 is less than str2 (alphabetically) str1 < str2 # str1 is less than str2 (alphabetically)
str1 > str2 # str1 is greater than str2 (alphabetically) str1 > str2 # str1 is greater than str2 (alphabetically)
-n str1 # str1 is not null (has length greater than 0) -n str1 # str1 is not null (has length greater than 0)
-z str1 # str1 is null (has length 0) -z str1 # str1 is null (has length 0)
# FILES # FILES
@ -411,7 +411,7 @@ function errtrap {
echo "ERROR line $1: Command exited with status $es." 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 { function dbgtrap {
echo "badvar is $badvar" echo "badvar is $badvar"