I have two files as below and I want to loop over the two files to create different combinations based on line in each file then input them as i
and j
to bash script in python:
file1
aaaa
tttt
cccc
gggg
file2
gggg
tttt
aaaa
cccc
ssss
I want to loop on the two files and then input them to a bash
script. so every combination of i
and j
should be an input for bash
script:
f1=[]
f2=[]
file1=open('file1.txt','r')
file2=open('file2.txt','r')
for i in file1:
f1.append(i)
for j in file2:
f2.append(j)
for i in f1:
for j in f2:
print(i)
print(j)
bashscript i j