我如何只打印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)