#!/bin/bash
function unzip_file(){
echo "$1"
for file in `ls $1 `
do
if [ -d $1"/"$file ]
then
unzip_file $1"/"$file
else
if [ "${file##*.}"x = "zip"x ];then
temp_file=$1"/"$file
#filelist[$i]="$temp_file"
unzip $temp_file -d $1
fi
if [ "${file##*.}"x = "rar"x ];then
temp_file=$1"/"$file
#filelist[$i]="$temp_file"
unrar e temp_file $1
fi
fi
done
}
unzip_file $1
function unzip_file(){
echo "$1"
for file in `ls $1 `
do
if [ -d $1"/"$file ]
then
unzip_file $1"/"$file
else
if [ "${file##*.}"x = "zip"x ];then
temp_file=$1"/"$file
#filelist[$i]="$temp_file"
unzip $temp_file -d $1
fi
if [ "${file##*.}"x = "rar"x ];then
temp_file=$1"/"$file
#filelist[$i]="$temp_file"
unrar e temp_file $1
fi
fi
done
}
unzip_file $1