Q:

read filters from a text file with tcpdump

i would like to know as the title describes if there is a way read filters from a file in tcpdump
currently i use  
tcpdump -r input.pcap -w output.pcap src host 1.1.1.1

and what i wan to do is make the tcpdump read the filter from a txt file, so the command would be something like   
tcpdump -r input.pcap -w output.pcap -filter myfilter.txt

is there a way to do that?

A:

From a five seconds web search and the TCPDUMP man page

OPTIONS
-F file
          Use file as input for the filter expression. An additional expression given on the command line is ignored.

A:

It's not specifically about tcpdump but you can do this with any command whatsoever with standard Unix shell "backtick"
$ tcpdump -r input.pcap -w output.pcap `cat myfilter.txt`

The -F file method with a specific flag is better if the command has it, as tcpdump does, but the backtick method will work for anything.

