ENVIRON
An array containing the values of the current environment. The array
is indexed by the environment variables, each element being the value of that variable (e.g., ENVIRON["HOME"] might be /home/arnold). Changing this arraydoes not affect the environment seen by programs which gawk
spawns via redirection or the system() function.
環境變數的設定,從介紹中可以看出其實是一個hash表,支援通過key來尋找value,不會改變系統當前的環境變數,gawk使用的是重新導向或者使用system函數的方法實現。
ERRNO
If a system error occurs either doing a redirection for getline, during a read for getline, or during aclose(), then ERRNO will contain a string describing the error. The value is subject to translation in non-English locales.
返回字串類型的錯誤碼
FIELDWIDTHS
A white-space separated list of fieldwidths. When set, gawk parses the input into fields of fixed width, instead of using the value of the FS variable as the field separator.
設定列寬,這個在嚴格設定大小的檔案中有用,對於列寬未知的情況,還是使用FS設定(但是可以肯定的是設定列寬的操作會更快,想一想問什麼:-))
FILENAME
The name of the current input file. If no files are specified on the command line, the value of FILE-NAME is <A1><B0>-<A1><B1>. However, FILENAME is undefined inside the BEGIN block (unless set by getline).
當前輸入檔案的名字,在BEGIN塊中是未定義的(除非使用getline函數指定)。
FNR
The input record number in the current input file.
輸入檔案中的記錄條數(因為記錄不一定從檔案的起始位置開始,而記錄之間不一定用換行區分,因此造就了這麼困難的表達……)
多理解理解。
IGNORECASE
Controls the case-sensitivity of all regular expression and string operations. If IGNORECASE has a non-zero value, then string comparisons and
pattern matching in rules, field splitting with FS, record separating with RS, regular expression matching with ~ and !~, and the gensub(), gsub(), index(), match(), split(), and sub() built-in functions all ignore case when doing regular expression
opera tions. NOTE: Array subscripting is not affected. However, the asort() and asorti() functions are affected. Thus, if IGNORECASE is not equal to zero, /aB/ matches all of the strings "ab", "aB", "Ab", and "AB".
As with all AWK variables, the initial value of IGNORECASE is zero, so all regular expression and string operations are normally case-sensitive. Under Unix, the full ISO 8859-1 Latin-1 character set is used when ignoring case.
設定大小寫敏感,針對正則和字串操作。
LINT
Provides dynamic control of the --lint option from within an AWK program. When true, gawk prints lint warnings. When false, it does not. When assigned the string value "fatal", lint warnings become fatal errors, exactly like --lint=fatal. Any other
true value just prints warnings.
可以用來設定警告為錯誤--lint=fatal。
NF
The number of fields in the current input record.
當前資料行列的個數。
NR
The total number of input records seen so far.
目前輸入的記錄個數。
OFMT
The output format for numbers, "%.6g", by default.
設定輸出數位格式。
OFS
The output field separator, a space by default.
設定輸出的列之間的分隔字元,預設為空白格
ORS
The output record separator, by default a newline.
設定記錄之間的分隔字元,預設為換行
PROCINFO
The elements of this array provide access to information about the running AWK program. On some sys tems, there may be elements in the array, "group1" through "groupn" for some n, which is the number of supplementary groups that the process
has. Use the in operator to test for these elements. The following elements are guaranteed to be available:
PROCINFO["egid"] the value of the getegid(2) system call.
PROCINFO["euid"] the value of the geteuid(2) system call.
PROCINFO["FS"] "FS" if field splitting with FS is in effect, or "FIELDWIDTHS" if field splitting with FIELDWIDTHS is in effect.
PROCINFO["gid"] the value of the getgid(2) system call.
PROCINFO["pgrpid"] the process group ID of the current process.
PROCINFO["pid"] the process ID of the current process.
PROCINFO["ppid"] the parent process ID of the current process.
PROCINFO["uid"] the value of the getuid(2) system call.
RS
The input record separator, by default a newline.
設定輸入記錄之間的分隔字元,預設為換行
RT
The record terminator. Gawk sets RT to the input text that matched the character or regular expression specified by RS.
設定為和RS一致的**,不管是正則還是字元。
RSTART
The index of the first character matched by match(); 0 if no match. (This implies that character indices start at one.)
match函數找到的合格第一個索引值,沒有找到的話為0
RLENGTH
The length of the string matched by match(); -1 if no match.
相同字元的長度。
SUBSEP
The character used to separate multiple subscripts in array elements, by default "\034".
TEXTDOMAIN
The text domain of the AWK program; used to find the localized translations for the program‘s strings.
不太理解,需要執行個體學習,mark。