
我需要根據條件停止tcpdump
或循環。tshark
目前我正在使用break
.
while IFS= read -r line; do if [[ $line =~ 'some protocol' ]]; then echo $line; break; fi; done < <(sudo tcpdump)
或者
while IFS= read -r line; do if [[ $line =~ 'some protocol' ]]; then echo $line; break; fi; done < <(sudo tshark)
我怎麼能以一種我沒有收到消息的方式做到這一點Unable to write output: Broken pipe