It's really difficult to explain why I need this- so I'm just going to describe what I need.
Basically, I need to use sed
(or awk
, or whatever) to add a sed
line to a specific spot inside a file. Namely, I have to find where in the file it says peer.i and starts a new line, and insert in the subsequent line my sed command.
This is my attempt:
sed -i "s/peer\.i\n/peer\.i\n\tsed -i 's/is_array/is_an_array/g' path_to_inside_file/g" path_to_outside_file
This didn't work, so I also tried this:
sed -i "s/peer\.i\n/peer\.i\n\tsed -i 's\/is_array\/is_an_array\/g' path_to_inside_file/g" path_to_outside_file
I'm not really sure why this isn't working, and any help/explanation would be appreciated.