Hi guys,
I'm pretty new in programming, very naive to be honest and I need some help, if possible.
I need to run a couple of commands for different files, and I thought using the loop for would be the best option. However, I don't know exactly how to NOT overwrite the output, I mean, I need one different file as output for each of the input files. I have tried something like:
for i in "file1.vcf" "file2.vcf" do
PASS filtering
grep -e "#" -e "PASS" /home/hpz440/Documents/example/input/$i > /home/hpz440/Documents//example/output/$i_PASS.vcf
echo $i
done
It didn't work. My idea was to use the name of the file in the output file name, so I wouldnt have the problem with overwriting.
Do you have any idea how can I improve this? The next step once this work, would be insert fiile1.vcf, file2.vcf as a list, so I could edit or add other files to analyze.
Thank you!