gawk-specific Features
The programs in this chapter and in
section Practical awk Programs,
freely use features that are specific to gawk.
This section briefly discusses how you can rewrite these programs for
different implementations of awk.
Diagnostic error messages are sent to `/dev/stderr'.
Use `| "cat 1>&2"' instead of `> "/dev/stderr"', if your system
does not have a `/dev/stderr', or if you cannot use gawk.
A number of programs use nextfile
(see section The nextfile Statement),
to skip any remaining input in the input file.
section Implementing nextfile as a Function,
shows you how to write a function that will do the same thing.
Finally, some of the programs choose to ignore upper-case and lower-case
distinctions in their input. They do this by assigning one to IGNORECASE.
You can achieve the same effect by adding the following rule to the
beginning of the program:
# ignore case
{ $0 = tolower($0) }
Also, verify that all regexp and string constants used in comparisons only use lower-case letters.
Go to the first, previous, next, last section, table of contents.