Last active
August 29, 2015 14:22
-
-
Save seebs/1aebbbecb98b532dc7da to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for subdir in *; do | |
mkdir -p "resorted" | |
for subsubdir in $subdir/*/; do | |
subsub=${subsubdir#*/} | |
mkdir -p resorted/$subsub | |
mv $subsubdir resorted/$subsub/$subdir | |
done | |
rm -r $subdir | |
done | |
mv resorted/* . | |
rmdir resorted |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment