Previous: , Up: Debugging   [Contents][Index]


14.1.3 Awk Debugging

Debugging an awk program has some specific aspects that are not shared with other programming languages.

First of all, the fact that awk programs usually take input line-by-line from a file or files and operate on those lines using specific rules makes it especially useful to organize viewing the execution of the program in terms of these rules. As we will see, each awk rule is treated almost like a function call, with its own specific block of instructions.

In addition, since awk is by design a very concise language, it is easy to lose sight of everything that is going on “inside” each line of awk code. The debugger provides the opportunity to look at the individual primitive instructions carried out by the higher-level awk commands.