Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Built-in Variables

All awk variables are included in gawk.

Version

Variable

Description

awk

ARGC

Number of arguments on the command line.

 

ARGV

An array containing the command-line arguments, indexed from 0 to ARGC - 1.

 

ENVIRON

An associative array of environment variables.

 

FILENAME

Current filename.

 

FNR

Like NR, but relative to the current file.

 

FS

Field separator (a space).

 

NF

Number of fields in current record.

 

NR

Number of the current record.

 

OFMT

Output format for numbers (“%.6g”).

 

OFS

Output field separator (a space).

 

ORS

Output record separator (a newline).

 

RLENGTH

Length of the string matched by match( ) function.

 

RS

Record separator (a newline).

 

RSTART

First position in the string matched by match( ) function.

 

SUBSEP

Separator character for array subscripts (“\034”).

 

$0

Entire input record.

 

$n

nth field in current record; fields are separated by FS.

gawk

ARGIND

Index in ARGV of current input file.

 

BINMODE

Controls binary I/O for input and output files. Use values of 1, 2, or 3 for input, output, or both kinds of files, respectively. Set it on the command line to affect standard input, standard output, and standard error.

 

ERRNO

A string indicating the error when a redirection fails for getline or if close( ) fails.

 

FIELDWIDTHS

A space-separated list of field widths to use for splitting up the record, instead of FS.

 

IGNORECASE

When true, all regular expression matches, string comparisons, and index( ) ignore case.

 

LINT

Dynamically controls production of “lint” warnings. With a value of “fatal”, lint warnings ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page