www.delorie.com/gnu/docs/sh-utils/sh-utils_29.html   search  
 
Buy GNU books!


GNU shell utilities

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.4.3 Relations for expr

expr supports the usual logical connectives and relations. These are higher precedence than either the string or numeric operators (previous sections). Here is the list, lowest-precedence operator first.

`|'
Returns its first argument if that is neither null nor 0, otherwise its second argument.

`&'
Return its first argument if neither argument is null or 0, otherwise 0.

`< <= = == != >= >'
Compare the arguments and return 1 if the relation is true, 0 otherwise. == is a synonym for =. expr first tries to coerce both arguments to numbers and do a numeric comparison; if either coercion fails, it does a lexicographic comparison.


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003