$ candump can0
$ candump can0 | grep <whatever>
$ candump can0 | grep 1A8 can0 1A8 [8] 3C 53 C5 FF 0D C3 3A 01 can0 1A8 [8] 3C 53 C5 FF 0D C3 3A 01
如果我尝试grep它两次:
candump can0 | grep 1A8 | grep 1A8
它什么也不返回。。。
Ps:可以用这个解决( candump can0,<whatever>,7ff | grep <whatever>
candump can0,<whatever>,7ff | grep <whatever>
编辑:为了清楚起见,如果我重复两次同样的事情,它仍然不起作用
问题并非来自 candump 但是从 grep 缓冲输出。
candump
grep
你可以找到一个很好的解释这种行为 here