Skip to content

Instantly share code, notes, and snippets.

@mathieu-aubin
Created October 7, 2016 19:07
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 mathieu-aubin/5fd2748463f4ace7e3af06d0b188fe5a to your computer and use it in GitHub Desktop.
Save mathieu-aubin/5fd2748463f4ace7e3af06d0b188fe5a to your computer and use it in GitHub Desktop.
#!/bin/bash
# To run as a script, leave as is. Save to file and chmod +x, then execute in the dir where zipfiles are.
# To use as a function, remove line 1, uncomment line 4 and 12 and call using unzip-all in the dir where zipfiles are.
#unzip-all() {
local dir='.';
[[ ! -z "${1// }" ]] && dir=$1;
for z in *.zip; do
q=$(echo $z | cut -f 1 -d '.');
unzip $z -d $dir/$q;
done;
#}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment