#!/bin/bash
function tcpdump_show(){
for file in `ls $1`
do
if [ -d $1"/"$file ]
then continue
else
if [ $file == "test.sh" ] #脚本名称为test.sh 与pcap放于同一目录
then continue
else
name=$file
txt=${name%.*}
tcpdump -r $name > $txt.txt
fi
fi
done
}
DIR="./"
tcpdump_show $DIR
本文介绍了一款使用bash脚本实现的自动化工具,该工具可以遍历指定目录下的所有pcap文件,并将它们转换成txt格式,方便进一步的数据分析和处理。脚本跳过了目录和特定的脚本文件,确保了转换过程的准确性和效率。
1702

被折叠的 条评论
为什么被折叠?



