1. 程式人生 > >文件重命名

文件重命名

ren one mage name bin for HA chapter ima

#!/bin/bash
#rename.sh

count=1

for img in *.[jJ][pP][gG]

do

new=image-$count.${img##*.}

mv "$img" "$new1" 2>/tmp/demo/chapter2/log.file

if [ $? -eq 0 ]
then
echo "Renaming $img to $new1"
let count++
fi

done

文件重命名