Closed liutgnu closed 3 months ago
Out of curiosity, I did a further look. According to this answer, this is because grep exits immediately when there is a match but the first cmd still keep writing to the pipe. Since there is no reader, a SIGPIPE signal is generated. This 141 exit code issue can be reproduced in the following way,
[root@localhost test]# seq 1 10000 | head -1
1
[root@localhost test]# echo $?
141
Can you include the above info the commit message? Btw, you may use "```" to wrap the debug info to have a better visual effect.
Hi Coiby,
Thanks a lot for finding out the root cause! It confused me for a long time. And I will update the commit log.
Thanks, Tao Liu
Hello @coiby , commit log updated, please have a review, thanks!