LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   looping files to run a body multiple times (https://www.linuxquestions.org/questions/linux-newbie-8/looping-files-to-run-a-body-multiple-times-4175520053/)

msarguru 09-25-2014 12:15 PM

looping files to run a body multiple times
 
Hi guys,
It will be great if someone can give some suggestions.....


### How to loop the body (shown below) to different "chr$" files, where dollar sign take different values (eg. 1,3,5,7,12).

#### Say for instance, for the first run it takes the value chr1 (and use it in the body) and then chr3 and so on.....


This is the body of the loop file:


/drn/common/u/snn/FAST/FAST.1.8.mc/bin/linux_x86_64/FAST \
--summary-file /drn/common/data/chr$.simple \
--hap-file /drn/common/CEU/chr$.hap.gz \
--pos-file /drn/common/CEU/chr$.hap.ra.gz \
--out-file /drn/common/output/out_chr$ \
--gene-set /drn/common/data/chr$.txt \
--chr $ \
--mode summary \
--n-sample 2000 \
--logistic-vegas-perm \


Thanks a bunch

szboardstretcher 09-25-2014 12:17 PM

You would be looking for a 'for loop' to do this.

http://tldp.org/LDP/abs/html/loops1.html


All times are GMT -5. The time now is 06:23 PM.