Skip to content

Instantly share code, notes, and snippets.

@maletor
Created February 14, 2012 07:15
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 maletor/1824441 to your computer and use it in GitHub Desktop.
Save maletor/1824441 to your computer and use it in GitHub Desktop.
Trying to append md5 on files in a certain subdirectory.
DIR="{$BASH_SOURCE[0]}../public/{assets,images}/**"
for F in $DIR/*.*; do
mv "$F" "${F}$(md5sum "$F" | cut -d' ' -f1).${F##*.}";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment