Using awk – Part 2
In this chapter, we’ll continue the discussion about awk
, but from a different perspective. In the previous chapter, I showed you the basics of creating one-line awk
commands that you can use in your normal shell scripts. In this chapter, I’ll show you a bit about how to write awk
scripts in the awk
language. Topics in this chapter include:
- Basic
awk
script construction - Using conditional statements
- Using a
while
construct and setting variables - Using for loops and arrays
- Using floating point math and
printf
- Working with multi-line records
If you’re ready, let’s dig in.