(coreutils.info)String tests


Next: Numeric tests Prev: File characteristic tests Up: test invocation
Enter node , (file) or (file)node

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.


automatically generated by info2www version 1.2.2.9