This chapter will focus on the usage of AWK variables. By the end of the chapter, the reader will understand how to use built-in and user-defined variables while writing AWK programs and command lines. Almost all expressions contain variables. Some of the variables are user-defined, while some are built-in, and others are fields. A variable is a named location that is either a string or a number, or both. User-defined variables in AWK consist of sequences of alphanumeric characters and underscores, with the exception that they do not begin with a digit. All built-in variables have uppercase names. The AWK variable type is not declared, but automatically infers the type from the context. When required, AWK converts a string value to a numeric value and vice versa. This chapter will give you a deep insight into different built-in and environment variables...




















































