Help. shell grep command, how to get a second string line before the specified number of rows content

I shell white. Existing functionality requires a script to achieve. But the shell command is not very clear. Gu for help to the great God who urged January.

Script demands: Great God can not pass found for "hello" prefix string, after locating the appropriate content, according to the conditions pick up, "*" in the beginning (red circle) to the second "*" end (on the red horizontal line) all the data. Figure:

Other ideas:

 I got the first two rows of data "hello" prefix comply with an order, how can I get in line before "hello" prefix in the second row content, that is, get set, lpush them on this basis.

 

Or is there another command to achieve this function.

 

Guess you like

Origin www.cnblogs.com/chengzile/p/10969253.html