home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: 11.3 Patterns and Procedures Chapter 11
The Awk Scripting Language
Next: 11.5 Operators
 

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.


Previous: 11.3 Patterns and Procedures UNIX in a Nutshell: System V Edition Next: 11.5 Operators
11.3 Patterns and Procedures Book Index 11.5 Operators

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System