The Evolution of the awk Language

The Evolution of the awk Language

This book describes the GNU implementation of awk, which follows the POSIX specification. Many awk users are only familiar with the original awk implementation in Version 7 Unix. (This implementation was the basis for awk in Berkeley Unix, through 4.3--Reno. The 4.4 release of Berkeley Unix uses gawk 2.15.2 for its version of awk.) This chapter briefly describes the evolution of the awk language, with cross references to other parts of the book where you can find more information.

Major Changes between V7 and SVR3.1

The awk language evolved considerably between the release of Version 7 Unix (1978) and the new version first made generally available in System V Release 3.1 (1987). This section summarizes the changes, with cross-references to further details.

Changes between SVR3.1 and SVR4

The System V Release 4 version of Unix awk added these features (some of which originated in gawk):

Changes between SVR4 and POSIX awk

The POSIX Command Language and Utilities standard for awk introduced the following changes into the language:

  • The use of `-W' for implementation-specific options.
  • The use of CONVFMT for controlling the conversion of numbers to strings (see section Conversion of Strings and Numbers).
  • The concept of a numeric string, and tighter comparison rules to go with it (see section Variable Typing and Comparison Expressions).
  • More complete documentation of many of the previously undocumented features of the language.

The following common extensions are not permitted by the POSIX standard:

Extensions in the AT&T Bell Laboratories awk

Brian Kernighan, one of the original designers of Unix awk, has made his version available via anonymous ftp (see section Other Freely Available awk Implementations). This section describes extensions in his version of awk that are not in POSIX awk.

Extensions in gawk Not in POSIX awk

The GNU implementation, gawk, adds a number of features. This sections lists them in the order they were added to gawk. They can all be disabled with either the `--traditional' or `--posix' options (see section Command Line Options).

Version 2.10 of gawk introduced these features:

Version 2.13 of gawk introduced these features:

Version 2.14 of gawk introduced these features:

Version 2.15 of gawk introduced these features:

  • The ARGIND variable, that tracks the movement of FILENAME through ARGV (see section Built-in Variables).
  • The ERRNO variable, that contains the system error message when getline returns -1, or when close fails (see section Built-in Variables).
  • The ability to use GNU-style long named options that start with `--' (see section Command Line Options).
  • The `--source' option for mixing command line and library file source code (see section Command Line Options).
  • The `/dev/pid', `/dev/ppid', `/dev/pgrpid', and `/dev/user' file name interpretation (see section Special File Names in gawk).

Version 3.0 of gawk introduced these features:



Mini annuaire : Gawk

Youhp3Youpee est un preprocesseur HTML pour vous simplifier toutes les tâches répétitives dans la création d'un site web. Salemioche.net utilise trés largement ses possibilités
cygwinle compilateur gcc sous windows ainsi que tous les outils unix (awk, grep, sed, bash, ksh ...)