sed -e'$!N;/\n|/P;D' \
<<""
Line 1
| Line2
Line 3
| Line 4
Line 5
| Line 6
Line 7
Line 8
Line 9
| Line 10
Line 11
Line 1
Line 3
Line 5
Line 9
Se ficar mais profundo ...
sed -e'/^ *|/!{$!N;/\n|/P;}' -eD \
<<""
Line 1
| Line2
| Line 3
|___| Line 4
| Line 5
|___Line 6
Line 7
Line 8
Line 9
| Line 10
Line 11
Line 1
Line 9
Você pode descartar grep
w / ...
sed -ne'/^Nmap.* /!{/^|.*: Win.*(W/!d;}' \
-e's///;/)/H;x;s/\n/: (W/p' \
<<""
Nmap scan report for 192.168.xx.xxx
Host is ...
bla... and more ...
and bla and so on...
#
Host script results:
| smb-os-discovery:
| OS: not windows Server (R) ... !(Windows Server (R) 2008 Standard 6.0)
| OS CPE: cpe:/o:microsoft:windows_server_2008::sp1
| Comp ... some words ...
| Net... more words ...
| Work... words again ...
|_ Sys...
#
Nmap scan report for 192.168.xx.xxx
Host is ...
MAC Address:
#
Host script results:
| smb-os-discovery:
| OS: Windows Server (R) 2008 Standard 6001 Service Pack 1 (Windows Server (R) 2008 Standard 6.0)
|_ System time: 2015-12-22T17:01:33-08:00
192.168.xx.xxx: (Windows Server (R) 2008 Standard 6.0)