Created
February 14, 2014 13:49
-
-
Save dettmering/9001277 to your computer and use it in GitHub Desktop.
Bash: Renames groups of images (329L_**_000x.tif) with a combined md5 hash of the group (329L_**-bac8dacd79_000x.tif)
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 | |
# Rename image files with md5 hash | |
mkdir out | |
for f in *.tif | |
do | |
splt=(${f//_/ }) | |
c=$(cat ${splt[0]}\_${splt[1]}\_* | md5) # 329L_23_* | |
o=${splt[0]}\_${splt[1]}\-${c:0:10}\_${splt[2]} | |
echo $o | |
cp $f out/$o | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment