How to write bash script to explode multiple zip files

I have a directory full of zip files.

How would I write a bash script to enumerate all the zip files, remove the ".zip" from the file name, create a directory by that name and unzip each zip file into its corresponding directory?

Thanks!
Siegfried

#!/bin/sh
for zip in *.zip
do
  dirname=`echo $zip | sed 's/\.zip$//'`
  if mkdir $dirname
  then
    if cd $dirname
    then
      unzip ../$zip
      cd ..
    else
      echo "Could not unpack $zip - cd failed"
    fi
  else
    echo "Could not unpack $zip - mkdir failed"
  fi
done

untested

It works great!!!
Thank you :cool:

Calling an external command for every file is very inefficient when it can be done in the shell itself:

dirname=${zip%.zip}