I have a file containing list of filenames, like this
file1.cfg
file2.cfg
file3.cfg
I want, using the linux terminal, to split this into n
files with the given filename, each also containing the filename as a string.
For example, after transformation I want the content of file1.cfg
to be
filename=file1.cfg
and in file2.cfg
filename=file2.cfg
etc.
What is the best way to accomplish this?