Summary
The awk
scripting language is exceedingly useful for anyone who needs to extract meaningful data from plain-text files. I began this chapter by showing you the basic construction of an awk
script. Then, I showed you how to use if
and if..else
to create conditional commands, how to use while
loops, and how to parse text files with multi-line records. For the demos, I showed you various awk
scripts that do the types of jobs that you might encounter in real life.
Unfortunately, there’s no way that I can do complete justice with this presentation of awk
. It’s another of those topics about which entire books have been written, so the best I can do here is to just whet your appetite.
In the next chapter, we’ll get back to the main topic of shell scripting, by looking at a couple of utilities that allow you to create user interfaces for your scripts. I’ll see you there.