I run your script, but I encountered this error.
[filter.c:1379 filters_init1] Error: the tag "INFO/GT[1" is not defined in the VCF header
this is header my vcf file:
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT EAZ01 EAZ02 EAZ03 EAZ04 EAZ06 EAZ08 EAZ20 EAZ21 EAZ25 EAZ26 GIL01 GIL03 GIL04 GIL05 GIL06 GIL08 GIL11 GIL14 GIL15 GIL17 KHU01 KHU02 KHU04 KHU05 KHU06 KHU07 KHU09 KHU12 KHU15 KHU17 MAZ01 MAZ02 MAZ03 MAZ04 MAZ05 MAZ08 MAZ10 MAZ12 MAZ13 MAZ19 WAZ01 WAZ02 WAZ03 WAZ04 WAZ05 WAZ06 WAZ07 WAZ08 WAZ12 WAZ16
Take a look at VCFtools
Usage guide
Many thanks for your reply,
I saw the page you shared. And the only thing I can find is the option --exclude-positions-overlap. Can you guide me more precisely?
In the first link you have different tools, as vcf-isec
See also : Obtain one vcf file of shared SNPs from input files with different samples using vcf-isec (vcftools)