O'Reilly logo

Learning AWK Programming by Shiwang Kalkhanda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

In this chapter, we learned to use print() and printf() for finer control over output. We began with OFS and ORS for formatting the output, which was followed by introduction to escape sequences in printf for printing special characters. Then we learned how AWK uses format-control characters for different data types, and optional modifiers for modifying the behavior of format control characters. Finally, we covered how the output from both print and printf can be redirected to files and pipes. In the end, we learned the importance of the close() function to close open files and pipes.

In the next chapter, we will learn about different types of expressions in AWK programming language and how they form the core logic of a program.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required