Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
sjmcefc2
V2EX  ›  Linux

请教 sed 怎么去除 Linux 文本的换行符号?

  •  
  •   sjmcefc2 · May 6, 2018 · 4496 views
    This topic created in 2927 days ago, the information mentioned may be changed or developed.

    sed -i 's/\n//g'

    这个貌似不行。

    helloiac
        2
    helloiac  
       May 7, 2018
    sed 是行处理,其处理对象已经是没有换行符的了,处理这种问题不方便。不过有缓存空间的概念,可以读入多行后处理,了解一下吧。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5630 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 69ms · UTC 03:45 · PVG 11:45 · LAX 20:45 · JFK 23:45
    ♥ Do have faith in what you're doing.