版本一:无并行
for i in {1..12}
do
{
echo start `date`
wget ftp://ftp.ncbi.nih.gov/snp/organisms/rice_4530/VCF/vcf_chr_${i}.vcf.gz
echo end `date`
}
done
cat *vcf.gz>rice_4530.vcf.gz
rm vcf_chr*
runtime=673s
版本二:并行
for i in {1..12}
do
{
echo start `date`
wget ftp://ftp.ncbi.nih.gov/snp/organisms/rice_4530/VCF/vcf_chr_${i}.vcf.gz
echo end `date`
} &
done
wait
cat *vcf.gz>rice_4530.vcf.gz
rm vcf_chr*
runtime=191s
并行下载的速度比无并行快3倍左右。
网友评论