开发者

Printing next line with sed

I want to print next line of matching word 开发者_Python百科with sed.

I tried this command but it gives error :

sed -n '/<!\[CDATA\[\]\]>/ { N p}/' test.xml


what about grep -e -A 1 regex? It will print line below regex.

With sed, looking for pattern "dd", below works fine as you would:

sed -n '/dd/ {n;p}' file

For file content:

dd
aa
ss
aa

It prints:

aa


use awk

awk '/pattern/{getline;print}' file
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜