- 论坛徽章:
- 145
|
本帖最后由 jason680 于 2014-09-29 11:09 编辑
回复 1# bulletmarquis
a|b c|d e|f g
1. 1st time, awk read first data and assign to $0
awk get "a" to assign $0
A: getline
get next data "b" to assign to $0
B: getline v
get next data "b" to assign to v
2. 2nd time, awk read next data and assign to $0
awk get "c" to assign $0
A: getline
get next data "d" to assign to $0
B: getline v
get next data "d" to assign to v
3. 3rd time, awk read next data and assign to $0
awk get "e" to assign $0
A: getline
get next data "f" to assign to $0
B: getline v
get next data "f" to assign to v
3. 4th time, awk read next data and assign to $0
awk get "g" to assign $0
A: getline
There is NO data to get and assign to $0
Note: $0 keep the original data "g"
B: getline v
There is NO data to get and assign to v
Note: v keep the original data "f"
Don't forget one thing
程序是
依照写出来(的code),跑出结果
不是依照你想出来的,得到结果
|
|