now i tried :
cat trio_example.vcf | awk '$1 ~ /^#/ {print $0;next} {print $0 | "sort -k1,1 -k2,2n"}' > out_sorted.vcf
bgzip -c out_sorted.vcf > trio_example.vcf.gz
tabix -p vcf trio_example.vcf.gz
and it works well. But what is the purpose of creating index file
By my count, that's already two questions unrelated to your original problem. You are yet to acknowledge the help you received, either verbally or by upvoting the answers. Instead, it is like "I need help, so it doesn't matter how many unrelated questions I ask in the same thread."
One would think this is your first time asking a question rather than having done it 100+ times. I guess there is some truth to the saying that if one doesn't learn something properly the first 3-4 times they do it, chances are they will never learn.