grub: test
16.3.74 test
------------
-- Command: test expression
Evaluate EXPRESSION and return zero exit status if result is true,
non zero status otherwise.
EXPRESSION is one of:
STRING1 '==' STRING2
the strings are equal
STRING1 '!=' STRING2
the strings are not equal
STRING1 '<' STRING2
STRING1 is lexicographically less than STRING2
STRING1 '<=' STRING2
STRING1 is lexicographically less or equal than STRING2
STRING1 '>' STRING2
STRING1 is lexicographically greater than STRING2
STRING1 '>=' STRING2
STRING1 is lexicographically greater or equal than STRING2
INTEGER1 '-eq' INTEGER2
INTEGER1 is equal to INTEGER2
INTEGER1 '-ge' INTEGER2
INTEGER1 is greater than or equal to INTEGER2
INTEGER1 '-gt' INTEGER2
INTEGER1 is greater than INTEGER2
INTEGER1 '-le' INTEGER2
INTEGER1 is less than or equal to INTEGER2
INTEGER1 '-lt' INTEGER2
INTEGER1 is less than INTEGER2
INTEGER1 '-ne' INTEGER2
INTEGER1 is not equal to INTEGER2
PREFIXINTEGER1 '-pgt' PREFIXINTEGER2
INTEGER1 is greater than INTEGER2 after stripping off common
non-numeric PREFIX.
PREFIXINTEGER1 '-plt' PREFIXINTEGER2
INTEGER1 is less than INTEGER2 after stripping off common
non-numeric PREFIX.
FILE1 '-nt' FILE2
FILE1 is newer than FILE2 (modification time). Optionally
numeric BIAS may be directly appended to '-nt' in which case
it is added to the first file modification time.
FILE1 '-ot' FILE2
FILE1 is older than FILE2 (modification time). Optionally
numeric BIAS may be directly appended to '-ot' in which case
it is added to the first file modification time.
'-d' FILE
FILE exists and is a directory
'-e' FILE
FILE exists
'-f' FILE
FILE exists and is not a directory
'-s' FILE
FILE exists and has a size greater than zero
'-n' STRING
the length of STRING is nonzero
STRING
STRING is equivalent to '-n STRING'
'-z' STRING
the length of STRING is zero
'(' EXPRESSION ')'
EXPRESSION is true
'!' EXPRESSION
EXPRESSION is false
EXPRESSION1 '-a' EXPRESSION2
both EXPRESSION1 and EXPRESSION2 are true
EXPRESSION1 EXPRESSION2
both EXPRESSION1 and EXPRESSION2 are true. This syntax is not
POSIX-compliant and is not recommended.
EXPRESSION1 '-o' EXPRESSION2
either EXPRESSION1 or EXPRESSION2 is true