Skip to content

Instantly share code, notes, and snippets.

@dmedvinsky
Created February 1, 2012 11:13
Show Gist options
  • Save dmedvinsky/1716592 to your computer and use it in GitHub Desktop.
Save dmedvinsky/1716592 to your computer and use it in GitHub Desktop.
#!/bin/bash
test -n "$1" || exit 1
test -d "$1" || exit 1
cd "$1" || exit 1
max() {
if (($1 > $2)); then
echo $1
else
echo $2
fi
}
files=(`ls *.lb`)
zs=(00 05 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100)
len=`max ${#files[@]} ${#zs[@]}`
for ((i = 0; i < $len; i++)); do
src="${files[$i]}"
dst="${zs[$i]}"
unzip -nd "$dst" "$src"
done
cd - > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment