#!/bin/bash if [ "x$1" = "x-j" ] ; then switch=-j shift fi for i in $* ; do dir=$(basename $i .zip) mkdir $dir cd $dir unzip $switch ../$i cd .. rm $i done