【发布时间】:2014-06-11 07:49:24
【问题描述】:
我正在使用 TCL 来控制流量生成器。收到流量后,我想使用shark命令将.pcap文件转换为.txt文件,然后我可以做一些其他的工作。
但是在程序中运行 exec 时会打印出以下信息:
在执行时 “执行 tshark -Vxr /var/tmp/PCRF/create_req.pcap” (“eval”正文第 1 行) 从内部调用 “eval exec {tshark -Vxr /var/tmp/PCRF/create_req.pcap}” (文件“./tcp_test.tcl”第 7 行)以下是TCL脚本:
# Radius accounting request start packets
# Version 1.0
# Date 2014/4/16 16:38
puts "\n Begin to decode the capture file\n"
#source /var/tmp/PCRF/convert_pcap.tcl
eval exec {tshark -Vxr /var/tmp/PCRF/create_req.pcap}
puts "\n end of the file decode and the result is rrr\n"
【问题讨论】:
-
只是确认一下:在其余的跟踪之前先是一个空行?
-
当我只使用exec时,以下是脚本和日志: puts "\n Begin to decode the capture file\n" #source /var/tmp/PCRF/convert_pcap.tcl exec tshark - Vxr /var/tmp/PCRF/create_req.pcap puts "\n end of the file decode and the result is rrr\n" 日志: -bash-3.2# tclsh ./tcp_test.tcl 开始解码捕获文件 运行为用户“root”和组“root”。这可能很危险。在执行“exec tshark -Vxr /var/tmp/PCRF/create_req.pcap”时(文件“./tcp_test.tcl”第7行)-bash-3.2#