I have three files with a list of files I need to use later to apply a function. I have managed to create a loop going through the 3 different files, but no exactly the output I need. My input: rw_sorted_test.txt
1
2
3
fwd_sorted_test.txt
A
B
C
run_list.txt
1st
2nd
3rd
I am running it like this:
for f in `cat rw_sorted_test.txt`; do for l in `cat fwd_sorted_test.txt`; do for r in `cat run_list.txt` do echo ${f} ${l} ${r}; done; done; done;
What I am obtain now is something like:
1 A 1st
1 A 2nd
1 A 3rd
2 A 1st
2 A 2nd
2 A 3rd
3 A 1st
(...)
What I am looking for is something like:
1 A 1st
2 B 2nd
3 C 3rd
I am sure that it will be something simple, but I am really beginner and all the workarounds have not been working. Also, how can I then make it run after echo my desired output? Thank you