coreutils: Relations for expr

1 
1 16.4.3 Relations for ‘expr’
1 ---------------------------
1 
1 ‘expr’ supports the usual logical connectives and relations.  These have
1 lower precedence than the string and numeric operators (previous
1 sections).  Here is the list, lowest-precedence operator first.
1 
1 ‘|’
1      Returns its first argument if that is neither null nor zero,
1      otherwise its second argument if it is neither null nor zero,
1      otherwise 0.  It does not evaluate its second argument if its first
1      argument is neither null nor zero.
1 
1 ‘&’
1      Return its first argument if neither argument is null or zero,
1      otherwise 0.  It does not evaluate its second argument if its first
1      argument is null or zero.
1 
1 ‘< <= = == != >= >’
1      Compare the arguments and return 1 if the relation is true, 0
1      otherwise.  ‘==’ is a synonym for ‘=’.  ‘expr’ first tries to
1      convert both arguments to integers and do a numeric comparison; if
1      either conversion fails, it does a lexicographic comparison using
1      the character collating sequence specified by the ‘LC_COLLATE’
1      locale.
1