我有一个非常简单的脚本要运行。它调用 tcpreplay 然后要求用户输入一些东西。然后读取将失败,读取:读取错误:0:资源暂时不可用。
这是代码
#!/bin/bash
tcpreplay -ieth4 SMTP.pcap
echo TEST
read HANDLE
echo $HANDLE
输出是
[root@vse1 quick_test]# ./test.sh
sending out eth4
processing file: SMTP.pcap
Actual: 28 packets (4380 bytes) sent in 0.53 seconds. Rated: 8264.2 bps, 0.06 Mbps, 52.83 pps
Statistics for network device: eth4
Attempted packets: 28
Successful packets: 28
Failed packets: 0
Retried packets (ENOBUFS): 0
Retried packets (EAGAIN): 0
TEST
./test.sh: line 6: read: read error: 0: Resource temporarily unavailable
[root@vse1 quick_test]#
我想知道在运行 tcpreplay 后是否需要关闭或清理任何句柄或管道?