abc = 1234
def = nnnn
ghi = XXX
jkl = yes
abc = 2345
def = nnoo
ghi = ZZZ
jkl = yes
abc = 6789
def = uuuu
ghi = XXX
jkl = no
I have output similar to the above and I can use sed to print lines above a regex or lines below. But how do I print above and below if I match a regex which in this case is XXX?
Example:
1234
nnnn
XXX
yes
6789
uuuu
XXX
no
Thanks!
def = nnnn
ghi = XXX
jkl = yes
abc = 2345
def = nnoo
ghi = ZZZ
jkl = yes
abc = 6789
def = uuuu
ghi = XXX
jkl = no
I have output similar to the above and I can use sed to print lines above a regex or lines below. But how do I print above and below if I match a regex which in this case is XXX?
Example:
1234
nnnn
XXX
yes
6789
uuuu
XXX
no
Thanks!