读书人

轮换目录里面的文件

发布时间: 2012-10-30 16:13:36 作者: rapoo

替换目录里面的文件
[ ! -f $1 ] && { echo "can not find the file:$1";exit 1; }
[ ! -d $2 ] && { echo "can not find the dir:$2";exit 1; }

fileName=`basename $1`
echo "$fileName"
for f in `find $2 -name $fileName`
do
echo "copy file $1 to $f"
cp $1 $f
done

echo "done"

读书人网 >编程

热点推荐