在perl脚本中运行tshark

在perl脚本中运行tshark,perl,tshark,Perl,Tshark,我尝试在perl脚本中运行tshark,只需执行以下操作- my $filter = "port 68 or 67"; my $capture = "tshark -i eth0 -f $filter -a duration:120 -w pcapture.pcap&"; system($capture); 此代码未启动tshark进程。建议进行任何更改?假设端口68或67是-f的合法值,则需要使用引号将其视为一个实体(包含空格的值): 您从系统中得到了什么错误代码? my $filt

我尝试在perl脚本中运行tshark,只需执行以下操作-

my $filter = "port 68 or 67";
my $capture = "tshark -i eth0 -f $filter -a duration:120 -w pcapture.pcap&";
system($capture);

此代码未启动tshark进程。建议进行任何更改?

假设
端口68或67
-f
的合法值,则需要使用引号将其视为一个实体(包含空格的值):


您从
系统
中得到了什么错误代码?
my $filter = "port 68 or 67";
my $capture = "tshark -i eth0 -f '$filter' -a duration:120 -w pcapture.pcap&";
system($capture);