shell 删除空行
2013-10-31 09:24
369 查看
grep: grep -v '^$' file
sed: sed '/^$/d' file 或 sed -n '/./p' file
awk: awk '/./ {print}' file
eg:
grep -v '^$' test.sh >test1.sh
mv test1.sh test.sh
删除空行重定向后,修改名称。
sed: sed '/^$/d' file 或 sed -n '/./p' file
awk: awk '/./ {print}' file
eg:
grep -v '^$' test.sh >test1.sh
mv test1.sh test.sh
删除空行重定向后,修改名称。
相关文章推荐
- shell删除所有空行(忽略编码格式)
- linux/shell 文本文件删除/删掉空行
- shell 删除空行
- Shell 删除文件的空行
- SHELL 删除文件中的空行或者空白行
- linux/shell 文本文件删除/删掉空行
- [Linux学习]Shell脚本(1)--函数,输入,if判断(持续更新)+删除空行 +保存当前路径
- shell sed 删除文件开头的空行
- shell脚本使用cat和EOF组合添加和删除文件内容
- 用shell脚本实现删除一定大小的文件
- shell 删除user1-user20
- linux删除空行 基本操作
- mongodb 中shell无法删除问题
- 浅谈如何删除JSP编译后的空行
- WinCC 卸载后 Simatic Shell 的删除
- Eclipse 删除 空行
- shell脚本删除分区
- phpstorm用正则删除PHP代码空行小技巧
- emeditor删除空行
- shell 批量增加、删除用户