21.07.2015 Views

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

GAWK: Effective AWK Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

vi<strong>G<strong>AWK</strong></strong>: <strong>Effective</strong> <strong>AWK</strong> <strong>Programming</strong>10 Advanced Features of gawk . . . . . . . . . . . . . . . . . 16910.1 Allowing Nondecimal Input Data. . . . . . . . . . . . . . . . . . . . . . . . . . . . 16910.2 Two-Way Communications with Another Process. . . . . . . . . . . . 17010.3 Using gawk for Network <strong>Programming</strong>. . . . . . . . . . . . . . . . . . . . . . . 17210.4 Using gawk with BSD Portals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17310.5 Profiling Your awk Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17311 Running awk and gawk . . . . . . . . . . . . . . . . . . . . . . 17711.1 Invoking awk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17711.2 Command-Line Options. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17711.3 Other Command-Line Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . 18211.4 The <strong>AWK</strong>PATH Environment Variable . . . . . . . . . . . . . . . . . . . . . . . . . 18311.5 gawk’s Exit Status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18411.6 Obsolete Options and/or Features . . . . . . . . . . . . . . . . . . . . . . . . . . . 18411.7 Undocumented Options and Features. . . . . . . . . . . . . . . . . . . . . . . . 18411.8 Known Bugs in gawk. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18512 A Library of awk Functions . . . . . . . . . . . . . . . . . 18612.1 Naming Library Function Global Variables . . . . . . . . . . . . . . . . . . 18612.2 General <strong>Programming</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18812.2.1 Implementing nextfile as a Function . . . . . . . . . . . . . . . . . . 18812.2.2 Converting Strings To Numbers . . . . . . . . . . . . . . . . . . . . . . . . 18912.2.3 Assertions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19012.2.4 Rounding Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19212.2.5 The Cliff Random Number Generator . . . . . . . . . . . . . . . . . . 19312.2.6 Translating Between Characters and Numbers . . . . . . . . . . 19312.2.7 Merging an Array into a String. . . . . . . . . . . . . . . . . . . . . . . . . 19512.2.8 Managing the Time of Day . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19512.3 Data File Management. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19712.3.1 Noting Data File Boundaries . . . . . . . . . . . . . . . . . . . . . . . . . . . 19712.3.2 Rereading the Current File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19812.3.3 Checking for Readable Data Files . . . . . . . . . . . . . . . . . . . . . . 19912.3.4 Checking For Zero-length Files . . . . . . . . . . . . . . . . . . . . . . . . . 19912.3.5 Treating Assignments as File Names. . . . . . . . . . . . . . . . . . . . 20012.4 Processing Command-Line Options . . . . . . . . . . . . . . . . . . . . . . . . . 20112.5 Reading the User Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20612.6 Reading the Group Database. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

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

Saved successfully!

Ooh no, something went wrong!