shell 根据源文件复制生成多个不重复的测试文件的脚本
#!/bin/bash # generate test data files if [ -n "$1" ] then echo 'source: '$1 else echo 'useage: '$0' sourceDataFile dstFileCount' exit 0 fi if [ -n "$2" ] then echo 'dstFileCount: '$2 else echo 'useage: '$0' sourceDataFile dstFileCount' exit 0 fi dt=`date +%Y-%m-%d'-'%H-%M-%S.%N` #echo $dt let count=$2 for ((i=1;i<=$count;i++)) do cp $1 'data-'$i'-'$dt'-'$1 done
////////////////////////////////
////////Sixi. Let it be.../////
//////////////////////////////