Skip to content

Instantly share code, notes, and snippets.

@mattak
Created April 9, 2013 11:56
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 mattak/5345120 to your computer and use it in GitHub Desktop.
Save mattak/5345120 to your computer and use it in GitHub Desktop.
rename drawable-{xx}dpi/${from}.png -> drawable-{xx}dpi/${to}.png
#!/bin/sh
#
# dpifile
#
# usage: dpifile help ic_help
#
if [ $# -lt 2 ]; then
echo "usage: [fromfile] [to_file]"
exit 0
fi
FROM_FILE=$1
TO_FILE=$2
for d in `find . -type d -depth 1 | grep drawable-`
do
cd $d
if [ -f $FROM_FILE.png ]; then
echo mv $FROM_FILE.png $TO_FILE.png
mv $FROM_FILE.png $TO_FILE.png
fi
cd - > /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment