V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
mrco
V2EX  ›  问与答

如何格式化输出多行内容?

  •  
  •   mrco · Sep 19, 2017 · 1510 views
    This topic created in 3151 days ago, the information mentioned may be changed or developed.

    vers 们好。

    我想将下面的 2 行输出整体的移动一个 tab 输出(放在变量里的),谢谢大家:

    file       disk       vda    /mnt/kvm/ssd/test.qcow2
    file       cdrom      hda    -
    
    1 replies    2017-09-19 16:51:36 +08:00
    mrco
        1
    mrco  
    OP
       Sep 19, 2017
    搞定:
    echo "${BlockInfo}"|awk '{print "\t" $F}'
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   868 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 21:36 · PVG 05:36 · LAX 14:36 · JFK 17:36
    ♥ Do have faith in what you're doing.