好使的方法就是能讓你省時购城,省力,爽虐译!
#!/bin/bash
start=`date +%s`
for file in `ls tot_*_sort_dss`;do
{
awk '{print $1"\t"$2}' $file > /data/amao/DSS/result/samplepos/$file.pos
echo 'success '$file;
}&
done
wait
end=`date +%s`
echo "TIME:`expr $end - $start`"
比如我要同時對3個樣本進行fastqc侮攀,我可以寫下面的shell腳本,同時批量進行:
ls *.sra
vi cmd2_sra2fq.sh
#!/bin/bash
fastq-dump EV1.sra & #&表示并行處理
fastq-dump EV2.sra &
fastq-dump EV3.sra &
wait
#利用多核優(yōu)勢厢拭,同時掛起兰英,然后繼續(xù)
fastqc EV1.sra &
fastqc EV2.sra &
fastqc EV3.sra &
wait
sh cmd2_sra2fq.sh