SHELL删除空白行
程序员文章站
2022-03-03 23:07:19
...
[email protected]:~$ cat file2.txt
Line 1 Line 2
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
[email protected]:~$ sed '/^$/d' file2.txt
Line 1 Line 2
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
[email protected]:~$ gawk '/./ {print $0}' file2.txt
Line 1 Line 2
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
上一篇: HashMap工作原理回顾 (基于JDK1.8源码分析)
下一篇: sed脚本之删除结尾的空白行