I have a file which requires modification via a shell script.
Need to do the following: 0. take input from user for new text. 1. search for a keyword in the file. 2. going forward, search for another keyword. 3. Replace this line with user supplied input.
I need to search the file for a keyword and rewrite the file replace the matching the next search line with the input to this script leaving the remaining content untouched.
I would actually suggest using see for this script. You can do inline editing. That means that you will replace files within the file and you won't have to create temp files and move them back to original.
I am in the middle of a meeting. I will respond with a sample script soon.