Added a quick script to rename files and add its 'extention' wich it extracts from the output of a 'file' command
parent
0bc7f2422d
commit
293511e102
@ -0,0 +1,16 @@
|
||||
for i;
|
||||
do
|
||||
real_ext=$(file $i | cut -d':' -f2 | cut -d' ' -f2)
|
||||
##echo $ext
|
||||
if [ $real_ext == "JPEG" ];
|
||||
then
|
||||
ext="jpg"
|
||||
elif [ $real_ext == "TIFF" ];
|
||||
then
|
||||
ext="tif"
|
||||
else
|
||||
ext=$real_ext
|
||||
fi
|
||||
new_ext=${ext,,}
|
||||
mv $i ${i%.*}.$new_ext
|
||||
done
|
||||
Loading…
Reference in new issue