Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Get the list with sed or awk

$
0
0
Code:

#cat file
[General]
aa
bb
cc
[Sabino B]
dd
ee
[XXX C]
[QQQ D]
[zzz D]
77
dd
[FAFS EE]
gg
xx

I want to get: when VAR="zzz D" get below out put
Code:

aa
bb
cc
77
dd

the rules is add General items to zzz D item. and get the list

Viewing all articles
Browse latest Browse all 16232

Trending Articles