String expression Flashcards

1
Q

[[ -n STRING ]]

A

Not empty string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

[[ -z STRING ]]

A

Empty string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

[[ STRING == STRING ]]

string1 == string2

A

STRINGs are equal.

== is used for POSIX compliance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

[[ STRING != STRING ]]

A

STRINGs are not equal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

[[ STRING =~ RegExp ]]

A

Regular Expression checking against the STRING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly