0

I am a rookie trying to learn command line functions properly. I have an Rscript code in linux that needs two files (FileType A and FileType B) at a time to function. For each file type, there are 7 different copies. I know how to use a for loop to iterate through the files of one type:

    for i in *_FileA; do Rscript code.R $i; done

However, I edited the R file in a way that I need two file inputs at a time and the file type pairs have to match. (1st Filetype A and 1st Filetype B), next (2nd Filetype A and 2nd Filetype B) etc. I don't think the following works:

    for i in *_FileA & for j in *_FileB; do Rscript code.R $i $j; done

Is there a way to achieve this? Thanks!

user20330606
  • 105
  • 7

0 Answers0