title: Redirecting vcftools file in linux - tips
body: <p>Here is the code that gets the VCF file from a specific region using <code>tabix</code> and then filters it for specific (european) population using 'keep' option from vcftools.</p>
  
  <pre><code>####select specific population
  if [ "$POP_FILE" != "" ]; then
      vcftools --vcf temp.vcf --keep $POP_FILE --recode --recode-INFO-all &gt; temp2.vcf 2&gt; /dev/null
  else
      cp -f temp.vcf temp2.vcf    
  fi
  </code></pre>
  
  <p><strong>PROBLEM</strong>: it creates the recode.vcf file but then the redirection is not happening as the temp2 file is empty</p>