Reputation: 63
I want to perform the following exercise in linux. Impute2 is command line based software. I want to change its options automatically using for-loops but its throwing following error in ** bold ** .
The -int option is range stating from ** $int1 to $int2 ** for every ** $chunk **.
It means that here for chunk 34 the int will be from 165752599 to 170752599 (difference of 5000001) and the for chunk 35 the int will be 170752600 to 175752600 and so on till last chunk i.e. chunk 49 and its int will be 240752614 to 245752614.
for chunk in $(seq 34 49)
for int1 in $(seq 165752599 5000001 240752614)
for int2 in $(seq 170752599 5000001 245752614)
do ./impute2 -use_prephased_g -m map.txt -h hap.txt -l legend.txt \
-known_haps_g knownhap.txt -strand_g chr1_pos_strand_new \
-align_by_maf_g -int $int1 $int2 -Ne 20000 -iter 30 -burnin 10 \
-k 80 -k_hap 500 -os 0 1 2 3 -o result.out -o_gz -r result.summary \
-i resul.info
done
done
done
** bash: syntax error near unexpected token 'for' **
Upvotes: 1
Views: 191
Reputation: 212208
You have 3 for
s and 3 done
s but only one do
. You need more do-do
!
ie, for x in a; do for y in b; do for z ...
Upvotes: 1