gawk: Preface
1
1 Preface
1 *******
1
1 Several kinds of tasks occur repeatedly when working with text files.
1 You might want to extract certain lines and discard the rest. Or you
1 may need to make changes wherever certain patterns appear, but leave the
1 rest of the file alone. Such jobs are often easy with 'awk'. The 'awk'
1 utility interprets a special-purpose programming language that makes it
1 easy to handle simple data-reformatting jobs.
1
1 The GNU implementation of 'awk' is called 'gawk'; if you invoke it
1 with the proper options or environment variables, it is fully compatible
1 with the POSIX(1) specification of the 'awk' language and with the Unix
1 version of 'awk' maintained by Brian Kernighan. This means that all
1 properly written 'awk' programs should work with 'gawk'. So most of the
1 time, we don't distinguish between 'gawk' and other 'awk'
1 implementations.
1
1 Using 'awk' you can:
1
1 * Manage small, personal databases
1
1 * Generate reports
1
1 * Validate data
1
1 * Produce indexes and perform other document-preparation tasks
1
1 * Experiment with algorithms that you can adapt later to other
1 computer languages
1
1 In addition, 'gawk' provides facilities that make it easy to:
1
1 * Extract bits and pieces of data for processing
1
1 * Sort data
1
1 * Perform simple network communications
1
1 * Profile and debug 'awk' programs
1
1 * Extend the language with functions written in C or C++
1
1 This Info file teaches you about the 'awk' language and how you can
1 use it effectively. You should already be familiar with basic system
1 commands, such as 'cat' and 'ls',(2) as well as basic shell facilities,
1 such as input/output (I/O) redirection and pipes.
1
1 Implementations of the 'awk' language are available for many
1 different computing environments. This Info file, while describing the
1 'awk' language in general, also describes the particular implementation
1 of 'awk' called 'gawk' (which stands for "GNU 'awk'"). 'gawk' runs on a
1 broad range of Unix systems, ranging from Intel-architecture PC-based
1 computers up through large-scale systems. 'gawk' has also been ported
1 to Mac OS X, Microsoft Windows (all versions), and OpenVMS.(3)
1
Menu