输入 - file1.txt
abc message=sent session:111,x,y,z
pqr message=receive session:111,4,5,7
abc message=sent session:123,x,y,z
pqr message=receive session:123,4,5,7
pqr message=receive session:123,4x,5x,7x
pqr message=receive session:123,4p,5q,7r
abc message=sent session:342,x,y,z
abc message=receive session:311,x,y,z
abc message=sent session:589,x,y,z
pqr message=receive session:589,4,5,7
输出
abc message=sent session:111,x,y,z,pqr message=receive session:111,4,5,7
abc message=sent session:123,x,y,z,pqr message=receive session:123,4,5,7,pqr message=receive session:123,4x,5x,7x,pqr message=receive session:123,4p,5q,7r
abc message=sent session:342,x,y,z,NOMATCH
abc message=receive session:311,x,y,z,NOMATCH
abc message=sent session:589,x,y,pqr message=receive session:589,4,5,7
笔记:
- 查找已发送及其立即接收 - 仅适用于 MATCHING 会话号
- 将所有会话匹配“接收”与相同的“发送”结合起来。例如:会话:123
- 如果没有“接收”,则打印 NOMATCH