File 1:
1F
2F
3F
4F
5f
File 2:
1F
2F
3F
4F
5f
I have a simple code that produces all possible combinations
#!/bin/bash
for a in $(awk '{print $1}' intf1)
do
for b in $(awk '{print $1}' intf2)
do
echo -e "$a:$b" >> file
done
done
Output of this code:
1F:1F
1F:2F
1F:3F
1F:4F
2F:1F
etc
But I would like to:
1) Completely avoid repetitions
2) "Select the number" (the number of words (lines) which he will be taken from the second file):
Each two lines in second file:
1F:2F
1F:3F
2F:3F
2F:4F
3F:4F
3F:5F
4F:5F
Each three lines in second file:
1F:2F
1F:3F
1F:4F
2F:3F
2F:4F
2F:5F
etc..
And etc