coreutils: String tests
16.3.4 String tests
-------------------
These options test string characteristics. You may need to quote STRING
arguments for the shell. For example:
test -n "$V"
The quotes here prevent the wrong arguments from being passed to
‘test’ if ‘$V’ is empty or contains special characters.
‘-z STRING’
True if the length of STRING is zero.
‘-n STRING’
‘STRING’
True if the length of STRING is nonzero.
‘STRING1 = STRING2’
True if the strings are equal.
‘STRING1 == STRING2’
True if the strings are equal (synonym for =).
‘STRING1 != STRING2’
True if the strings are not equal.