下面的bash似乎在上一个done上出错了。什么是正确的语法,因为我似乎无法弄清楚,如果没有创建更多的错误。由于当前抛出错误,在此之后有一些附加进程将不会运行。谢谢:)。
误差
/home/cmccabe/Desktop/loop.sh: line 79: syntax error near unexpected token `done'
/home/cmccabe/Desktop/loop.sh: line 79: `done >> "$logfile"'bash
logfile=/home/cmccabe/Desktop/NGS/API/6-2-2016/process.log
for file in /home/cmccabe/Desktop/NGS/API/6-2-2016/vcf/overall/stats/*.vcf ; do
echo "Start annovar creation: $(date) - file: $file"
echo ${file##*/} >> /home/cmccabe/Desktop/NGS/annovar/target.txt
cp /home/cmccabe/Desktop/NGS/API/6-2-2016/vcf/overall/stats/*.vcf /home/cmccabe/Desktop/NGS/annovar
echo "End annovar file creation: $(date) - file: $file"
done
logfile=/home/cmccabe/Desktop/NGS/API/6-2-2016/process.log
cd "/home/cmccabe/Desktop/NGS/annovar"
$( perl -ne 'chomp; system ("perl table_annovar.pl -vcfinput $_ humandb/ -buildver hg19 -arg '-hgvs',,,,,,,,,, -remove -protocol IDP.refGene,avsnp147,popfreq_all_20150413,spidex,ljb26_sift,ljb26_pp2hdiv,ljb26_pp2hvar,ljb26_lrt,ljb26_mt,ljb26_ma,clinvar_20160302 -operation g,f,f,f,f,f,f,f,f,f,f")' < target.txt )
mv /home/cmccabe/Desktop/NGS/annovar/*multianno.txt /home/cmccabe/Desktop/NGS/API/6-2-2016/vcf/overall/annovar
echo "End annovar annotation creation: $(date) - file: $file"
done >> "$logfile"发布于 2016-08-11 16:57:54
您希望>>位于echo行,就像这样。done也是多余的;没有需要关闭的循环:
logfile=/home/cmccabe/Desktop/NGS/API/6-2-2016/process.log
cd "/home/cmccabe/Desktop/NGS/annovar"
$( perl -ne 'chomp; system ("perl table_annovar.pl -vcfinput $_ humandb/ -buildver hg19 -arg '-hgvs',,,,,,,,,, -remove -protocol IDP.refGene,avsnp147,popfreq_all_20150413,spidex,ljb26_sift,ljb26_pp2hdiv,ljb26_pp2hvar,ljb26_lrt,ljb26_mt,ljb26_ma,clinvar_20160302 -operation g,f,f,f,f,f,f,f,f,f,f")' < target.txt )
mv /home/cmccabe/Desktop/NGS/annovar/*multianno.txt /home/cmccabe/Desktop/NGS/API/6-2-2016/vcf/overall/annovar
# See here
echo "End annovar annotation creation: $(date) - file: $file" >> "$logfile"https://stackoverflow.com/questions/38902146
复制相似问题