源码
#!/bin/bash
count=0
for file in `ls $1 | grep 'template'`;
do
newfile=`echo $file | sed s/-template//g`
echo $file" -> "$newfile
cp $1/$file $1/$newfile
((count++))
done
echo "has copy "$count" numbers file."
使用方法
$ bash test.sh documentName