| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A.1 Major Changes Between V7 and SVR3.1
The awk language evolved considerably between the release of
Version 7 Unix (1978) and the new version that was first made generally available in
System V Release 3.1 (1987). This section summarizes the changes, with
cross-references to further details:
-
The requirement for ‘;’ to separate rules on a line
(see section
awkStatements Versus Lines). -
User-defined functions and the
returnstatement (see section User-Defined Functions). -
The
deletestatement (see section ThedeleteStatement). -
The
do-whilestatement (see section Thedo-whileStatement). -
The built-in functions
atan2(),cos(),sin(),rand(), andsrand()(see section Numeric Functions). -
The built-in functions
gsub(),sub(), andmatch()(see section String-Manipulation Functions). -
The built-in functions
close()andsystem()(see section Input/Output Functions). -
The
ARGC,ARGV,FNR,RLENGTH,RSTART, andSUBSEPbuilt-in variables (see section Built-in Variables). -
Assignable
$0(see section Changing the Contents of a Field). - The conditional expression using the ternary operator ‘?:’ (see section Conditional Expressions).
-
The expression ‘index-variable in array’ outside of
forstatements (see section Referring to an Array Element). - The exponentiation operator ‘^’ (see section Arithmetic Operators) and its assignment operator form ‘^=’ (see section Assignment Expressions).
-
C-compatible operator precedence, which breaks some old
awkprograms (see section Operator Precedence (How Operators Nest)). -
Regexps as the value of
FS(see section Specifying How Fields Are Separated) and as the third argument to thesplit()function (see section String-Manipulation Functions), rather than using only the first character ofFS. - Dynamic regexps as operands of the ‘~’ and ‘!~’ operators (see section How to Use Regular Expressions).
-
The escape sequences ‘\b’, ‘\f’, and ‘\r’
(see section Escape Sequences).
(Some vendors have updated their old versions of
awkto recognize ‘\b’, ‘\f’, and ‘\r’, but this is not something you can rely on.) -
Redirection of input for the
getlinefunction (see section Explicit Input withgetline). -
Multiple
BEGINandENDrules (see section TheBEGINandENDSpecial Patterns). - Multidimensional arrays (see section Multidimensional Arrays).
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on March 30, 2012 using texi2html 5.0.