Skip to content

Instantly share code, notes, and snippets.

@jinqian
Created June 13, 2013 17:36
Show Gist options
  • Save jinqian/5775657 to your computer and use it in GitHub Desktop.
Save jinqian/5775657 to your computer and use it in GitHub Desktop.
my 1st bash
#!/bin/bash
match="large"
for i in ./cover/*/*; do
folder=$(dirname $i)
fname=$(basename $i)
if [[ "$fname" == *$match* ]]; then
#tgt=$(echo $i | sed -e "s/$re_match/$replace/")
mv "$i" "$folder/large_cover.jpg"
else
mv "$i" "$folder/cover.jpg"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment