Skip to content

Instantly share code, notes, and snippets.

@alexpwf
Created July 27, 2017 12:15
Show Gist options
  • Save alexpwf/0a377ea40b43719d7d3087d38fec0c0e to your computer and use it in GitHub Desktop.
Save alexpwf/0a377ea40b43719d7d3087d38fec0c0e to your computer and use it in GitHub Desktop.
scrypt to rename file import from illustrator in the various folders of android studio.
#! /bin/bash
name="mipmap"
cd "$name-mdpi/"
for i in *mdpi.png; do
mv "$i" "${i/mdpi/}"
done
cd ..
cd "$name-hdpi/"
for i in *hdpi.png; do
mv "$i" "${i/hdpi/}"
done
cd ..
cd "$name-xhdpi/"
for i in *xhdpi.png; do
mv "$i" "${i/xhdpi/}"
done
cd ..
cd "$name-xxhdpi/"
for i in *xxhdpi.png; do
mv "$i" "${i/xxhdpi/}"
done
cd ..
cd "$name-xxxhdpi/"
for i in *xxxhdpi.png; do
mv "$i" "${i/xxxhdpi/}"
done
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment