Created
October 11, 2019 21:15
-
-
Save yvovandoorn/ef967817ba791306f3d2e8f3a12b5c78 to your computer and use it in GitHub Desktop.
This file contains 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/bash | |
DEST="/Users/yvo/Desktop/logos2" | |
# Run this from devopsdays-web/static/events | |
for i in $(ls); do echo $i >> /tmp/cities; done | |
awk -F"-" '{ print $2}' /tmp/cities | sort | uniq > /tmp/stripped | |
for i in $(cat /tmp/stripped); do | |
for j in {2010..2020}; do | |
if [ -d $j-$i ]; then | |
if [ -f $j-$i/logo.png ]; then | |
cp -f $j-$i/logo.png $DEST/$i.png | |
else | |
if [ -f $j-$i/logo.jpg ]; then | |
cp -f $j-$i/logo.jpg $DEST/$i.jpg | |
if [ -f $DEST/$i.png ]; then | |
rm -f $DEST/$i.png | |
fi | |
fi | |
fi | |
else echo "file not found" | |
fi | |
done | |
done | |
rm -f /tmp/cities /tmp/stripped |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment