I am trying to search for a particular line in a file using
grep command and I am successful doing that.
Now I want to copy the entire line to a new line right after the original line. In other words, the original line should be followed by the new line with same content with some prefix.
For example: Original data :
Apple Samsung Nokia HTC
Say if I want the new data to look like
Apple Samsung prefix Samsung Nokia HTC
Note: I have multiple patterns with
Samsung, where ever I found that it should do the same.
I tried to
grep and pipe with
sed and I failed. Can anyone please help me with this?