#!/bin/bash
echo "par1 is gene,par2 is fst_file"
#awk '{(if ($3==gene) print $0}' $2>gene_info
grep -i $1 gene_info|awk '{print $2,$3,$4}'>${1}_info
while read chr start end
do
awk -v chr=$chr -v start=$start -v end=$end '{if($1==chr && $2>=start && $2<=end) print $0}' $2>${1}_fst
done<${1}_info
标签:end,基因,start,chr,fst,单个,awk,gene
From: https://www.cnblogs.com/xiaosagege/p/16619418.html