我使用:
cat display.txt | sed -e 's/...\(.*\).../\1/g'
获取(“…”)之间的字符串。但是,它给了我这个结果,这是文件的全部内容。我怎样才能从中提取出
"hhgggeeee"
?= New Index: 98:4F:EE:06:0B:03 (BR/EDR,UART,hci0)
[hci0] 0.595705 > ACL Data RX: Handle 12 flags 0x02 dlen 19
[hci0] 11.420307 Channel: 64 len 15 [PSM 0 mode 0] {chan 0}
1b ef 17 68 68 67 67 67 65 65 65 65 0d 0a 8f
...hhgggeeee... > HCI Event: Mode Change (0x14) plen 6 [hci0] 11.923905
Status: Success (0x00) Handle: 12 Mode: Active (0x00)
Interval: 0.000 msec (0x0000)
最佳答案
$ sed -n 's/.*\.\{3\}\(.*\)\.\{3\}.*/\1/p' file
hhgggeeee