2021年4月22日星期四

for loop egrep with brace expansion

I am trying to write a for to extract the values of MQ from a VCF files and then create a new files with .tmp extension.

for i in $(find -name "*.vcf")  do echo $i        filename=${i%.p*}      echo $filename      egrep -o  "MQ=[[:digit:]]{,3}..{2}?" $i > ${filename}.tmp  done  

While it creates files with the appropriate names, the content of all the *.tmp files are the same. What am I doing wrong?

https://stackoverflow.com/questions/67223598/for-loop-egrep-with-brace-expansion April 23, 2021 at 11:28AM

没有评论:

发表评论