Variables play an important role when creating AWK scripts and programs. They modify the behavior of AWK commands. AWK built-in variables have uppercase names. These built-in variables can be used in all expressions, and can be reset by the user. They are set automatically. The following sections discuss the different built-in variables in AWK.
Built-in variables in AWK
Field separator
The field separator (FS) is either a single character or a regular expression. It decides the way AWK splits an input record into fields. The FS is represented by the built-in variable FS, and its default value is a single space. It tells AWK to separate fields across any number of spaces and/or tabs.