Skip to content

Instantly share code, notes, and snippets.

@vzsg
Created November 8, 2016 13:59
Show Gist options
  • Save vzsg/f19f888baa0d54ea33db8a9bdf2187c7 to your computer and use it in GitHub Desktop.
Save vzsg/f19f888baa0d54ea33db8a9bdf2187c7 to your computer and use it in GitHub Desktop.
for file in *.png
do
name=$(echo ${file%_*.png} | tr '[:upper:]' '[:lower:]' | tr ' ' '_')
tmp=${file##*_}
res=${tmp%.png}
mkdir -p drawable-$res
echo $file "->" drawable-$res/$name.png
mv "$file" "drawable-$res/$name.png"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment