I am trying to change some lines of a code using sed by reading another list of 7000+ lines using cat.
I tried to do :
for i in `cat namefile`; do sed 's/OG0000047/$i/g' paml.ctr > paml_$i.ctr; done
My code (paml.ctr):
seqfile = OG0000047.phy
treefile = OG0000047.treefile
outfile = OG0000047_results
My list (namefile):
OG0000047
OG0000076
OG0000080
OG0000194
OG0000223
OG0000255
OG0000271
So read the names on the namefile and change OG0000047 to the names, save into a new file. However, of course, my $I in the sed command does not work and I end up with $I in my code instead of the actual names
Does anyone knows how to solve this issue?