I'm new here. I registered my self today with this board because I hope to get some help before I'll become a slavering maniac.
I'm really desperate, since I'm trying for hours(really!) to let grep search a pattern that goes about 2 lines.
The pattern is as follows:
Handle 0x000xxxxxxx
Memory Module Information
I tried it as follows:
grep -i -E 'handle .*memory module information' -A 8
I also did that:
grep -i -E 'handle .*memory module information/m' -A 8
and that:
grep -i -E '^handle .*[\n]memory module information' -A 8
For the last 3 and a half hours I read so many pages about egrep, but nothing answers my question. It simply doesn't work.
That was what I thought myself at first, but the problem is, that sed gives me also lines like that:
Handle 0x0025, DMI type 32, 11 bytes
System Boot Information
Status: No errors detected
and that is not what I want.
I want solely lines that start with a handel information like the one above followed by "Memory Module Information" and the next 8 lines that follow up.
Thank you very much, but that doesn't work either. It produces the same output as described above. That means it will show lines like:
Handle 0x0025, DMI type 32, 11 bytes System Boot Information Status: No errors detected
because it starts with "handle". I want only output if "handle" will be followed by "memory module information" in the next line. I've got some working code, but it's AWK and that's a language I don't know even a bit, so I'm looking for the same thing with grep or sed. This is it in awk: