I got a file that contains the following content, Actually it is a part of the file content,
Installing XYZ XYZA Image, API 18, revision 2
Unzipping XYZ XYZA Image, API 18, revision 2 (1%)
Unzipping XYZ XYZA Image, API 18, revision 2 (96%)
Unzipping XYZ XYZA Image, API 18, revision 2 (99%)
Installed XYZ XYZA Image, API 18, revision 2
This part of the file repeats through out the file some "n" times.
The problem in front of me is i need to extract the bold line that repeats n times in the file and put them into another file.
I tried this piece of code but in vain.
grep -o "Installed*" filename > destfile
This actually matches the pattern and puts the lines after the required line.
In your example input, is that actually 5 lines, or 1 line which has line-wrapped? Because neither of those grep commands should concatenate output lines like that.
Alternatively, is the output directly from grep, or are you doing something else with it first?
Yes neither of the commands concatenate output lines as i said.
I am trying to cat the output of the grep command inside mail delivery system,
Thats the reason the lines are concatenating.
Can you please suggest what i need to do???
The piece of code just after grep would be something like this,