#! /bin/bash
for img in *.[Jj][Pp][Gg]
do
stat -c %y $img >>stat
done
cut -c -16 stat >>new_stat
rm stat
count=1
re=1
for img in *.[Jj][Pp][Gg]
do
name[ $count ]=$img
let count++
done
count=1
while read -r line
do
find ${name[$count]}
if [ $? -eq 0 ]
then
mv ${name[$count]} "$line($re)"
let re++
else
mv ${name[$count]} "$line"
fi
let count++
done < new_stat
rm new_stat
利用shell按创建时间批量重命名照片
最新推荐文章于 2021-02-06 19:09:57 发布