21.07.2015 Views

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

260 <strong>G<strong>AWK</strong></strong>: <strong>Effective</strong> <strong>AWK</strong> <strong>Programming</strong>• The ability to delete all of an array at once with ‘delete array’ (see Section 8.1.3[String-Manipulation Functions], page 132).• The ability for the length function to accept an array argument and return the numberof elements in the array. (see Section 7.6 [The delete Statement], page 123).A.5 Extensions in gawk Not in POSIX awkThe GNU implementation, gawk, adds a large number of features. This section lists them inthe order they were added to gawk. They can all be disabled with either the ‘--traditional’or ‘--posix’ options (see Section 11.2 [Command-Line Options], page 177).Version 2.10 of gawk introduced the following features:• The <strong>AWK</strong>PATH environment variable for specifying a path search for the ‘-f’ commandlineoption (see Section 11.2 [Command-Line Options], page 177).• The IGNORECASE variable and its effects (see Section 2.6 [Case Sensitivity in Matching],page 32).• The ‘/dev/stdin’, ‘/dev/stdout’, ‘/dev/stderr’ and ‘/dev/fd/N’ special file names(see Section 4.7 [Special File Names in gawk], page 69).Version 2.13 of gawk introduced the following features:• The FIELDWIDTHS variable and its effects (see Section 3.6 [Reading Fixed-Width Data],page 48).• The systime and strftime built-in functions for obtaining and printing timestamps(see Section 8.1.5 [Using gawk’s Timestamp Functions], page 146).• The ‘-W lint’ option to provide error and portability checking for both the source codeand at runtime (see Section 11.2 [Command-Line Options], page 177).• The ‘-W compat’ option to turn off the GNU extensions (see Section 11.2 [Command-Line Options], page 177).• The ‘-W posix’ option for full POSIX compliance (see Section 11.2 [Command-LineOptions], page 177).Version 2.14 of gawk introduced the following feature:• The next file statement for skipping to the next data file (see Section 6.4.9 [Usinggawk’s nextfile Statement], page 109).Version 2.15 of gawk introduced the following features:• The ARGIND variable, which tracks the movement of FILENAME through ARGV (seeSection 6.5 [Built-in Variables], page 110).• The ERRNO variable, which contains the system error message when getline returns−1 or close fails (see Section 6.5 [Built-in Variables], page 110).• The ‘/dev/pid’, ‘/dev/ppid’, ‘/dev/pgrpid’, and ‘/dev/user’ file name interpretation(see Section 4.7 [Special File Names in gawk], page 69).• The ability to delete all of an array at once with ‘delete array’ (see Section 7.6 [Thedelete Statement], page 123).• The ability to use GNU-style long-named options that start with ‘--’ (see Section 11.2[Command-Line Options], page 177).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!