小编use*_*110的帖子

如何仅打印前后包含空行的行

我如何只打印line(s)前后包含空白的行。我正在尝试各种 awk 和 grep 组合,但不知何故无法获得它。

tuv0657


tuv2330


tuv2133              Unable to get the ssh connection


tuv1988              Unable to get the ssh connection


tuv1049


tuv1683              Unable to get the ssh connection


tuv2101
Run Code Online (Sandbox Code Playgroud)

期望:

tuv0657
tuv1049
tuv2330
tuv2101
Run Code Online (Sandbox Code Playgroud)

我试过的:

我在下面试过但没有得到结果..

$ awk  '{if ($2=="") print $0}' file
$ grep -E --line-number --with-filename '^$'
Run Code Online (Sandbox Code Playgroud)

awk sed

0
推荐指数
1
解决办法
71
查看次数

标签 统计

awk ×1

sed ×1