#!/bin/bash for i in *.zip ; do NAME=${i/.zip} echo $NAME unzip $i if [[ -f $NAME/gradle/wrapper/gradle-wrapper.properties ]] ; then cp gradle-wrapper.properties $NAME/gradle/wrapper/ zip -9 $i $NAME/gradle/wrapper/gradle-wrapper.properties fi rm -rf $NAME done