awk内建变量

1069阅读 0评论2010-07-07 wcw
分类:

 FILENAME  输入文件名称
 FNR  当前输入文件记录数(当前行号)
 FS  字段分隔符,默认为' '
 NF  当前记录的字段数
 NR  在工作(job)中记录数
 OFS  输出字段分隔符
 ORS  输出记录分隔符
 RS  输入记录分隔符,默认为'\n'
ARGC        The number of command line arguments (does not include  options to gawk, or the program source).   命令行参数的个数
ARGIND      The index in ARGV of the current file being processed. 命令行中文件序号
ARGV        Array of command line arguments. The array is indexed
                   from 0 to ARGC - 1. Dynamically changing the contents
                   of ARGV can control the files used for data. 命令行参数数组

参考:http://hi.baidu.com/ptf_phoenix/blog/item/855a51c77da472dad0006052.html
上一篇:时间戳转为格式化时间
下一篇:object 和 function及判断方法