Hi.
I have this format on a textfile:
VG Name /dev/vg00
PV Name /dev/dsk/c16t0d0
PV Name /dev/dsk/c18t0d0
PV Name /dev/dsk/c16t4d0
VG Name /dev/vg01
PV Name /dev/dsk/c18t2d0
PV Name /dev/dsk/c16t2d0
VG Name /dev/vgsapQ45
PV Name /dev/dsk/vpath8
PV Name /dev/dsk/vpath6
PV Name /dev/dsk/vpath7
PV Name /dev/dsk/vpath5
VG Name /dev/vgsapT45
PV Name /dev/dsk/vpath18
PV Name /dev/dsk/vpath16
PV Name /dev/dsk/vpath17
I want to extract the "VG Name" BUT only if the line under have "vpath" in it.
So the output I want is for this:
VG Name /dev/vgsapQ45
VG Name /dev/vgsapT45
I tried using regular expression but cant get it to span across multiple lines.
Anyone have an easy solution for this? awk, grep or egrep ???
/Jocke