Section 11.1. Conceptual Overview


11.1. Conceptual Overview

awk is a pattern-matching program for processing files, especially when each line has a simple field-oriented layout. Linux provides the GNU version of awk, called gawk, which provides a number of additional features. This utility can be invoked either through the standard name awk or through gawk.

Items described here as "common extensions" are available in gawk and most versions of awk offered on other operating systems (often called nawk for "new awk"), but should not be used if strict portability of your programs is important to you.

With gawk, you can:

  • Think of a text file as made up of records and fields in a textual database.

  • Perform arithmetic and string operations.

  • Use programming constructs, such as loops and conditionals.

  • Produce formatted reports.

  • Define your own functions.

  • Execute Unix commands from a script.

  • Process the results of Unix commands.

  • Process command-line arguments gracefully.

  • Work easily with multiple input streams.

  • Flush open output files and pipes.

  • Sort arrays.

  • Retrieve and format system time values.

  • Do bit manipulation.

  • Internationalize your gawk programs, allowing strings to be translated into a local language at runtime.

  • Perform two-way I/O to a coprocess.

  • Open a two-way TCP/IP connection to a socket.

  • Dynamically add built-in functions.

  • Profile your gawk programs.



Linux in a Nutshell
Linux in a Nutshell
ISBN: 0596154488
EAN: 2147483647
Year: 2004
Pages: 147

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net