Bash Scripting Flashcards
is equal to
-eq
if [ “$a” -eq “$b” ]
is not equal to
-ne
if [ “$a” -ne “$b” ]
is greater than
-gt
if [ “$a” -gt “$b” ]
is greater than or equal to
-ge
if [ “$a” -ge “$b” ]
is less than
if-lt
[ “$a” -lt “$b” ]
is less than or equal to
-le
if [ “$a” -le “$b” ]
is less than
<
(within double parentheses)
((“$a” < “$b”))
is less than or equal to
<=
(within double parentheses)
((“$a” <= “$b”))
is greater than
>
(within double parentheses)
((“$a” > “$b”))
is greater than or equal to
> =
(within double parentheses)
((“$a” >= “$b”))
is equal to
= (or ==)
if [ “$a” = “$b” ]
is not equal to
!=
if [ “$a” != “$b” ]
string is null, that is, has zero length
-z
string is null, that is, has zero length
string is not null
-n
logical ‘and’
-a
exp1 -a exp2
returns true if both exp1 and exp2 are true