#!/bin/bash
# 递归文件夹,查询zip文件
function readZipFile ()
{
for file in `ls $1`
do
# -d表示这个是 文件夹
if [ -d $1"/"$file ]
then
# 是文件夹就递归
readZipFile $1"/"$file
else
# 判断是否是zip文件
if echo $1"/"$file | grep -q -E '.zip'
then
# 输出文件的地址
echo $1"/"$file
fi
fi
done
}
path="/home/"
readZipFile $path