Skip to content

Instantly share code, notes, and snippets.

@jimkang
Created February 19, 2021 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimkang/69bb7ffb4718d26eb78de45a20e43fad to your computer and use it in GitHub Desktop.
Save jimkang/69bb7ffb4718d26eb78de45a20e43fad to your computer and use it in GitHub Desktop.
When you download from Bandcamp, the zip file comes with no directory structure, so this gives it one. Explanation: https://jimkang.com/weblog/articles/bandcamp-unzip/
#!/bin/bash
for file in *.zip
do
filename="${file%.*}"
# Filenames can't contain /. So, I wonder
# what Bandcamp would do if they had AC/DC?
unzippath=$(echo "$filename" |sed -e 's/ - /\//')
mkdir -p "$unzippath"
unzip "$filename" -d "$unzippath"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment