Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning AWK Programming

You're reading from  Learning AWK Programming

Product type Book
Published in Mar 2018
Publisher Packt
ISBN-13 9781788391030
Pages 416 pages
Edition 1st Edition
Languages
Author (1):
Shiwang Kalkhanda Shiwang Kalkhanda
Profile icon Shiwang Kalkhanda

Table of Contents (11) Chapters

Preface Getting Started with AWK Programming Working with Regular Expressions AWK Variables and Constants Working with Arrays in AWK Printing Output in AWK AWK Expressions AWK Control Flow Statements AWK Functions GNU's Implementation of AWK – GAWK (GNU AWK) Practical Implementation of AWK

GNU's Implementation of AWK – GAWK (GNU AWK)

This chapter covers the features of GNU AWK (GAWK) that are not available in primitive AWK. These features are not connected to each other, but are quite useful when used in the appropriate scenarios. Features such as reading non-decimal input, arbitrary precision arithmetic, array sorting, and some advance features such as network communication, debugging, and inter-process communication, are explained in this chapter using simple example programs. Some of these features are quite advanced, in the sense that their explanation requires a separate chapter devoted to them. However, we will discuss the main details of these features, so that we are able to use them when the situation arises. These features enhance the power of AWK and make it more productive.

In this chapter, we will cover the following :

  • Reading non-decimal...

Things you don't know about GAWK

All features which are there in AWK are available as default in GAWK. In addition to these features, there are some other features of GAWK that essentially require a mention—they are covered in this section. These are not interrelated, so moving from one feature to another will be like picking up a random tool from a box filled with essential utilities.

Reading non-decimal input

The non-decimal values are like octal numbers or hexadecimal numbers. We cannot use these values to print their decimal equivalent with AWK; GAWK provides the option, --non-decimal-data, to print non-decimal values in the output. Octal values need to be prefixed with 0 and hexadecimal values need to be prefixed...

Summary

In this chapter, we learned about the features which are available in GAWK but not in AWK. We began with features such as handling non-decimal input, two-way inter-process communication, sorting of arrays, network programming and the GAWK built-in command line debugger. Finally, we learned about profiling using GAWK, for optimizing GAWK programs.

In our next chapter, we will cover some use case examples of text-processing using AWK for system administrators and programmers.

lock icon The rest of the chapter is locked
You have been reading a chapter from
Learning AWK Programming
Published in: Mar 2018 Publisher: Packt ISBN-13: 9781788391030
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}