[Chapter 11] 11.4 Awk System Variables
Author: Daniel Gilly & the Staff of O'Reilly & Associates
Date: 1998-08-06T22:00:20Z

#

| Chapter 11 The Awk Scripting Language |

## 11.4 Awk System Variables

Version | Variable | Description
--- | --- | ---
awk | FILENAME | Current filename.
| FS | Field separator (default is a blank).
| NF | Number of fields in current record.
| NR | Number of the current record.
| OFS | Output field separator (default is a blank).
| ORS | Output record separator (default is a newline).
| RS | Record separator (default is a newline).
| $0 | Entire input record.
| $`n` | `n`th field in current record; fields are separated by FS.
nawk | ARGC | Number of arguments on command line.
| ARGV | An array containing the command-line arguments.
| FNR | Like NR, but relative to the current file.
| OFMT | Output format for numbers (default is %.6g).
| RSTART | First position in the string matched by match function.
| RLENGTH | Length of the string matched by match function.
| SUBSEP | Separator character for array subscripts (default is \034).
gawk | ENVIRON | An associative array of environment variables.
| IGNORECASE | An associative array of environment variables.

11.3 Patterns and Procedures |  | 11.5 Operators