#!/bin/sh
#设置相关参数
CURPATH="/bea/wangyy/myshell/test1"
tail=".cpp"
newtail=".xpp"
#进入相应目录
cd $CURPATH
#获得全部文件列表
FILES=`ls *$tail`
for FF in $FILES
do
echo $FF
subpos=`expr index "$FF" "$tail"`
echo $subpos
filepre=${FF:0:subpos-1}
echo $filepre
mv $FF $filepre$newtail
done
exit
阅读(1496) | 评论(0) | 转发(0) |