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

通过传参得到数据,再写入另外一个文件的时候格式乱了

  •  
  •   krisbai · Dec 7, 2017 · 1612 views
    This topic created in 3089 days ago, the information mentioned may be changed or developed.
    如题,传参到一个文本的格式是按列排序的,通过 echo 写入另外一个文件后格式完全乱了。请教下需要加什么参数才能保证格式不变?
    原格式:
    version: '2'
    services:
    jetty.$service_name:
    restart: always
    写入到新文件后的格式:
    version: '2' services: jetty.test: restart: always
    1 replies    2017-12-07 16:33:42 +08:00
    sutra
        1
    sutra  
       Dec 7, 2017
    注意 *nix 和 Windows 上的换行的区别,*nix 是 \n, Windows 是 \r\n
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   898 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 20:04 · PVG 04:04 · LAX 13:04 · JFK 16:04
    ♥ Do have faith in what you're doing.