代码: 全选
#! /bin/sh
find $PWD | while read i
do
if [ -d $i ]; then
continue
fi
test=`echo $i | grep '.mp3`
if [ "$test" = "" ]; then
mv $i $i.mp3
fi
done
然后想写个脚本修改,发现不会写递归遍历所有子目录。。。求教~

代码: 全选
find . -type f |
while read i
do
mv $i $i.mp3
done
代码: 全选
rename 's/$/.mp3/' **/*(.)