'How to find out tshark boolean filter is empty?

I have a tshark with the following usage:

tshark -r my_pcap_file.pcap -Y 'my and boolean statement'

Now, I want to write a capture file with -w , But before any writing file, I have to find out my tshark is empty or not. How to can I do it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source