[BACK]Return to awk.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / awk

Diff for /src/usr.bin/awk/awk.1 between version 1.29 and 1.30

version 1.29, 2008/06/04 14:04:42 version 1.30, 2008/06/04 17:14:07
Line 425 
Line 425 
 .El  .El
 .Sh FUNCTIONS  .Sh FUNCTIONS
 The awk language has a variety of built-in functions:  The awk language has a variety of built-in functions:
 arithmetic, string, input/output and general.  arithmetic, string, input/output, general, and bit-operation.
   .Pp
   Functions may be defined (at the position of a pattern-action statement)
   thusly:
   .Pp
   .Dl function foo(a, b, c) { ...; return x }
   .Pp
   Parameters are passed by value if scalar, and by reference if array name;
   functions may be called recursively.
   Parameters are local to the function; all other variables are global.
   Thus local variables may be created by providing excess parameters in
   the function definition.
 .Ss Arithmetic Functions  .Ss Arithmetic Functions
 .Bl -tag -width "atan2(y, x)"  .Bl -tag -width "atan2(y, x)"
 .It Fn atan2 y x  .It Fn atan2 y x
Line 678 
Line 689 
 .Fa cmd  .Fa cmd
 and returns its exit status.  and returns its exit status.
 .El  .El
 .Ss Bit-Operation functions  .Ss Bit-Operation Functions
 .Bl -tag -width "lshift(a, b)"  .Bl -tag -width "lshift(a, b)"
 .It Fn compl x  .It Fn compl x
 Returns the bitwise complement of integer argument x.  Returns the bitwise complement of integer argument x.
 .It Fn and x y  .It Fn and x y
 Performs a bitwise AND on integer arguments x and y  Performs a bitwise AND on integer arguments x and y.
 .It Fn or x y  .It Fn or x y
 Performs a bitwise OR on integer arguments x and y  Performs a bitwise OR on integer arguments x and y.
 .It Fn xor x y  .It Fn xor x y
 Performs a bitwise Exclusive-OR on integer arguments x and y  Performs a bitwise Exclusive-OR on integer arguments x and y.
 .It Fn lshift x n  .It Fn lshift x n
 Returns x shifted by n bits to the left.  Returns x shifted by n bits to the left.
 .It Fn rshift x n  .It Fn rshift x n
 Returns y shifted by n bits to the right.  Returns y shifted by n bits to the right.
 .El  .El
 .Pp  
 Functions may be defined (at the position of a pattern-action statement)  
 thusly:  
 .Pp  
 .Dl function foo(a, b, c) { ...; return x }  
 .Pp  
 Parameters are passed by value if scalar, and by reference if array name;  
 functions may be called recursively.  
 Parameters are local to the function; all other variables are global.  
 Thus local variables may be created by providing excess parameters in  
 the function definition.  
 .Sh EXAMPLES  .Sh EXAMPLES
 Print lines longer than 72 characters:  Print lines longer than 72 characters:
 .Pp  .Pp
Line 770 
Line 770 
 .Op Fl \&dV  .Op Fl \&dV
 and  and
 .Op Fl safe ,  .Op Fl safe ,
 as well as the command  as well as the commands
 .Cm fflush , compl , and , or , xor , lshift , rshift  .Cm fflush , compl , and , or ,
   .Cm xor , lshift , rshift ,
 are extensions to that specification.  are extensions to that specification.
 .Sh HISTORY  .Sh HISTORY
 An  An

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30