shell脚本写循环
$ head -n 10 main_process.log
2022-05-18.09:42:13||0, read hash file herb2number.hash.tsv
2022-05-18.09:42:13||0, read input data ipgs_input_table.tsv
2022-05-18.09:42:13||0, create block.
2022-05-18.09:42:14||0, create block completed.
Start processing task queue, the queue length is 2135445
2022-05-18.09:42:14||0, main send [1, 2, 3] to 258
2022-05-18.09:42:14||0, main send [1, 2, 4] to 35
2022-05-18.09:42:14||0, main send [1, 2, 5] to 9
2022-05-18.09:42:14||0, main send [1, 2, 6] to 243
2022-05-18.09:42:14||0, main send [1, 2, 7] to 133
找出每个进程最后运行的5个Block List
$ for i in {1..300} ; do grep "to ${i}$" main_process.log | tail -n 5 >> main_process.log.last; done