I'm trying to run a command from the 'plink1.9' program for population genetics, whilst changing two of the parameters.
In the code below, the first parameter, i, is either 1 or 100, and the second parameter, j, is either 0.4 or 0.8. I'd hope that this generates four different outputs, with each including the corresponding input parameter values in the output file name.
This is my code, which fails with 'syntax error near unexpected token 'do''.
for i in 1 100
do
for j in 0.4 0.8
do
plink --bfile myfile \
--indep-pairwise ${i} 50 ${j} \
--out myfile_${i}_50_${j}_indep
done
done
If anyone has any suggestions as to how I can fix this, I'd be very appreciative. I have tried several variations on this. Ideally I'd run multiple commands through the loop, change all three of the variables instead of just two, and have more than two possible values for each variable but I'll keep it simple until it works.
do\ris not recognized as the expected keyword)? I'll note thatbash4.4 now gives a much clearer error message in such cases.