#!/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