String expression Flashcards
1
Q
[[ -n STRING ]]
A
Not empty string
2
Q
[[ -z STRING ]]
A
Empty string
3
Q
[[ STRING == STRING ]]
string1 == string2
A
STRINGs are equal.
== is used for POSIX compliance
4
Q
[[ STRING != STRING ]]
A
STRINGs are not equal
5
Q
[[ STRING =~ RegExp ]]
A
Regular Expression checking against the STRING