[BACK]Return to expr.1 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / bin / expr

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/bin/expr/expr.1 between version 1.15 and 1.16

version 1.15, 2000/10/30 16:20:12 version 1.16, 2001/05/07 10:14:43
Line 15 
Line 15 
 .Sh DESCRIPTION  .Sh DESCRIPTION
 The  The
 .Nm  .Nm
 utility evaluates  utility evaluates
 .Ar expression  .Ar expression
 and writes the result on standard output.  and writes the result on standard output.
 .Pp  .Pp
Line 28  Operators are listed below in order of i
Line 28  Operators are listed below in order of i
 Operators with equal precedence are grouped within { } symbols.  Operators with equal precedence are grouped within { } symbols.
 .Bl -tag -width indent  .Bl -tag -width indent
 .It Ar expr1 Li | Ar expr2  .It Ar expr1 Li | Ar expr2
 Returns the evaluation of  Returns the evaluation of
 .Ar expr1  .Ar expr1
 if it is neither an empty string nor zero;  if it is neither an empty string nor zero;
 otherwise, returns the evaluation of  otherwise, returns the evaluation of
 .Ar expr2 .  .Ar expr2 .
Line 39  Returns the evaluation of
Line 39  Returns the evaluation of
 if neither expression evaluates to an empty string or zero;  if neither expression evaluates to an empty string or zero;
 otherwise, returns zero.  otherwise, returns zero.
 .It Ar expr1 Li "{=, >, >=, <, <=, !=}" Ar expr2  .It Ar expr1 Li "{=, >, >=, <, <=, !=}" Ar expr2
 Returns the results of integer comparison if both arguments are integers;  Returns the results of integer comparison if both arguments are integers;
 otherwise, returns the results of string comparison using the locale-specific  otherwise, returns the results of string comparison using the locale-specific
 collation sequence.  collation sequence.
 The result of each comparison is 1 if the specified relation is true,  The result of each comparison is 1 if the specified relation is true,
Line 49  Returns the results of addition or subtr
Line 49  Returns the results of addition or subtr
 .It Ar expr1 Li "{*, /, %}" Ar expr2  .It Ar expr1 Li "{*, /, %}" Ar expr2
 Returns the results of multiplication, integer division, or remainder of integer-valued arguments.  Returns the results of multiplication, integer division, or remainder of integer-valued arguments.
 .It Ar expr1 Li : Ar expr2  .It Ar expr1 Li : Ar expr2
 The  The
 .Dq \:  .Dq \:
 operator matches  operator matches
 .Ar expr1  .Ar expr1
 against  against
 .Ar expr2 ,  .Ar expr2 ,
 which must be a regular expression.  The regular expression is anchored  which must be a regular expression.  The regular expression is anchored
 to the beginning of  the string with an implicit  to the beginning of  the string with an implicit
 .Dq ^ .  .Dq ^ .
 .Pp  .Pp
 If the match succeeds and the pattern contains at least one regular  If the match succeeds and the pattern contains at least one regular
 expression subexpression  expression subexpression
 .Dq "\e(...\e)" ,  .Dq "\e(...\e)" ,
 the string corresponding to  the string corresponding to
 .Dq "\e1"  .Dq "\e1"
 is returned;  is returned;
 otherwise the matching operator returns the number of characters matched.  otherwise the matching operator returns the number of characters matched.
 If the match fails and the pattern contains a regular expression subexpression  If the match fails and the pattern contains a regular expression subexpression
 the null string is returned;  the null string is returned;
 otherwise 0.  otherwise 0.
Line 78  Operator precedence (from highest to low
Line 78  Operator precedence (from highest to low
 .It  .It
 parentheses  parentheses
 .It  .It
 arithmetic operators, compare operators,  
 .Dq \:  .Dq \:
 operator  .It
   .Dq "*" ,
   .Dq "/" ,
   and
   .Dq "%"
   .It
   .Dq "+"
   and
   .Dq "-"
   .It
   compare operators
 .It  .It
 .Dq &  .Dq &
 operator  
 .It  .It
 .Dq \Z'\*[tty-rn]'|  .Dq \Z'\*[tty-rn]'|
 operator  
 .El  .El
 .Sh EXAMPLES  .Sh EXAMPLES
 .Bl -enum  .Bl -enum

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

CVSweb <webmaster@jp.NetBSD.org>