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.

Appendix A: The Evolution of the awk Language 259• More complete documentation of many of the previously undocumented features of thelanguage.The following common extensions are not permitted by the POSIX standard:• \x escape sequences are not recognized (see Section 2.2 [Escape Sequences], page 25).• Newlines do not act as whitespace to separate fields when FS is equal to a single space(see Section 3.2 [Examining Fields], page 39).• Newlines are not allowed after ‘?’ or ‘:’ (see Section 5.12 [Conditional Expressions],page 92).• The synonym func for the keyword function is not recognized (see Section 8.2.1[Function Definition Syntax], page 153).• The operators ‘**’ and ‘**=’ cannot be used in place of ‘^’ and ‘^=’ (see Section 5.5[Arithmetic Operators], page 81, and Section 5.7 [Assignment Expressions], page 83).• Specifying ‘-Ft’ on the command line does not set the value of FS to be a single TABcharacter (see Section 3.5 [Specifying How Fields Are Separated], page 43).• The locale’s decimal point character is used for parsing input data (see Section 2.9[Where You Are Makes A Difference], page 35).• The fflush built-in function is not supported (see Section 8.1.4 [Input/Output Functions],page 143).A.4 Extensions in the Bell Laboratories awkBrian Kernighan, one of the original designers of Unix awk, has made his version availablevia his home page (see Section B.6 [Other Freely Available awk Implementations], page 281).This section describes extensions in his version of awk that are not in POSIX awk:• The ‘-mf N’ and ‘-mr N’ command-line options to set the maximum number of fieldsand the maximum record size, respectively (see Section 11.2 [Command-Line Options],page 177). As a side note, his awk no longer needs these options; it continues to acceptthem to avoid breaking old programs.• The fflush built-in function for flushing buffered output (see Section 8.1.4[Input/Output Functions], page 143).• The ‘**’ and ‘**=’ operators (see Section 5.5 [Arithmetic Operators], page 81 andSection 5.7 [Assignment Expressions], page 83).• The use of func as an abbreviation for function (see Section 8.2.1 [Function DefinitionSyntax], page 153).The Bell Laboratories awk also incorporates the following extensions, originally developedfor gawk:• The ‘\x’ escape sequence (see Section 2.2 [Escape Sequences], page 25).• The ‘/dev/stdin’, ‘/dev/stdout’, and ‘/dev/stderr’ special files (see Section 4.7[Special File Names in gawk], page 69).• The ability for FS and for the third argument to split to be null strings (seeSection 3.5.2 [Making Each Character a Separate Field], page 45).• The nextfile statement (see Section 6.4.9 [Using gawk’s nextfile Statement],page 109).

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

Saved successfully!

Ooh no, something went wrong!