Hello Brothers and Sisters.
I am trying to write a script to change change 100's of files. Change a line if it exists or add it if it doesn't exist.
I'm having multiple issues.
I thought I would grep to see which files don't have the line. Then from that array add the line. all the rest just switch the line.
I'm having problems with grep
I'm reading in a list of files.
I want to grep which files have the line with bgs in it.
Replace that line with the new line which is the new way to start Best1.
Many of the files don't have the line. So, for the files that don't have it. I need to add it.
Then, I am going to open another file and do some more stuff to that. So, some of this code may not make sense.
THANK You!