About Us Documentation

Contact Site Map



GAWK Manual - The Evolution of the awk Language Go to the previous, next chapter.

The Evolution of the awk Language

This manual describes the GNU implementation of awk, which is patterned after the POSIX specification. Many awk users are only familiar with the original awk implementation in Version 7 Unix, which is also the basis for the version in Berkeley Unix (through 4.3--Reno). This chapter briefly describes the evolution of the awk language.

  • V7/S5R3.1: The major changes between V7 and System V Release 3.1.
  • S5R4: Minor changes between System V Releases 3.1 and 4.
  • POSIX: New features from the posix standard.
  • POSIX/GNU: The extensions in gawk not in posix awk.

Major Changes between V7 and S5R3.1

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

Changes between S5R3.1 and S5R4

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

Changes between S5R4 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 Comparison Expressions).

  • More complete documentation of many of the previously undocumented features of the language.

Extensions in gawk not in POSIX awk

The GNU implementation, gawk, adds these features:

  • The AWKPATH environment variable for specifying a path search for the -f command line option

  • The various gawk specific features available via the -W command line option. 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 IGNORECASE variable and its effects (see section Case-sensitivity in Matching).

  • The FIELDWIDTHS variable and its effects (see section Reading Fixed-width Data).

  • The next file statement for skipping to the next data file (note:The next file Statement).

  • The systime and strftime built-in functions for obtaining and printing time stamps (see section Functions for Dealing with Time Stamps).

  • The /dev/stdin, /dev/stdout, /dev/stderr, and /dev/fd/n file name interpretation (see section Standard I/O Streams).

  • The -W compat option to turn off these extensions .
  • The -W posix option for full POSIX compliance .