文档介绍:AWK (Aho, Kernighan, and Weinberger) Summary
Predefined Variable Summary:
Support:
Variable Description AWK NAWK GAWK
FS Input Field Separator, a space by default.
OFS Output Field Separator, a space by default.
NF The Number of Fields in the current input record.
NR The total Number of input Records seen so far.
RS Record Separator, a newline by default.
ORS Output Record Separator, a newline by default.
The name of the current input file. If no files are specified on mand line,
FILENAME the value of FILENAME is "-". However, FILENAME is undefined inside the
BEGIN block (unless set by getline).
The number mand line arguments (does not include options to gawk, or the
ARGC program source). Dynamically changing the contents of ARGV control the files
used for data.
ARGV Array mand line arguments. The array is indexed from 0 to ARGC - 1.
ARGIND The index in ARGV of the current file being processed.
On non-POSIX systems, specifies use of "binary" mode for all file I/O.
Numeric values of 1, 2, or 3, specify that input files, output files, or all files,
respectively, should use binary I/O. String values of "r", or "w" specify that input
BINMODE files, or output files, respectively, should use binary I/O. String values of "rw" or
"wr" specify that all files should use binary I/O.