0

I have a script like this:

#!bin/bash
for FILE in *.score; do
  plink2 --pfile Predix_chr22.doseN.new.pgen --psam  Predix_chr22.doseN.new.psam --pvar Predix_chr22.doseN.new.pvar --pgen Predix_chr22.doseN.new.pgen --score ${FILE} 1 2 4 --out ${FILE}.edic22
done

so I have 22 of those Predix_chr* files. How would I run this to loop over all those files and change generate the output for each ${FILE}.edic accordingly? I understand I would need to put this loop inside the other loop and replace these numbers,22 in this case with the variable I am looping over. So my numbers go from 1 to 22.

  • 3
    something like for file in *.score; do for num in {1..22}; do stuff_to ${file}_${num}; done; done. – DopeGhoti May 24 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.