- 论坛徽章:
- 0
|
看看这个就知道了
getline Set $0 from next input record; set NF , NR, FNR. Returns 0 on EOF and –1 on an error. Upon an
error, ERRNO contains a string describing the problem.
getline <file Set $0 from next record of file; set NF.
getline var Set var from next input record; set NR, FNR.
getline var <file Set var from next record of file.
command | getline [var]
Run command piping the output either into $0 or var, as above. If using a pipe or co-process to
getline, or from print or printf within a loop, you must use close() to create new instances
command |& getline [var]
Run command as a co-process piping the output either into $0 or var, as above. Co-processes are a
gawk extension. |
|