Question: I've figured out that extracting a `.zip` you need the path to the directory as well when you are recursively looking through subdirectories. So how do you store the path?
This is nearly there but doesn't work properly when there is a space in the `{zip_file}`.

```
zip_dir=$PWD/$(basename "${zip_file}")

```

Answer: 
I created this from your other question as well. It took me a bit, but this is what I was able to come up with to create the folders based on the zip file name, removing the `.zip` from the folder name, then extracting the zip file into that folder.

```
#!/bin/bash

echo "Start folder create..."
find . -type f -iname "*.zip" | while read filename
do
 filename1=${filename:2}
 foldername=$PWD/"${filename1%.*}"
 mkdir -p "$foldername"
 unzip "$filename" -d "$foldername"
 echo "Created directory $foldername and extracted files to it." 
done

```

The line `filename1=${filename:2}` strips off the `./` of the name.
Edit: I must not have tested this correctly.

Generally you don't need quotes when doing a variable assignment, just when dereferencing a variable. When making an assignment you don't need to put quotes around a variable being dereferenced, but since the dereferencing happens in a sub shell, quotes are needed around the `${zip_file}` part so that it's value is properly passed to basename. Quotes are *NOT* in fact needed around the entire line, because then it's back in the context of variable assignment, where quotes aren't needed as bash will do the right thing with passing the value from the subshell to the assignment line.

Thanks @janos for pointing this out. I'm not sure what I screwed up in testing the original line that took me down the path of excessive quotes. You are correct, the following is fine:

```
zip_dir=$PWD/$(basename "${zip_file}")

```