mrco
V2EX  ›  问与答

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

  •  
  •   mrco · Sep 19, 2017 · 1790 views
    This topic created in 3347 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
    mrco
    OP
    Sep 19, 2017
    1
    搞定:
    echo "${BlockInfo}"|awk '{print "\t" $F}'
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2420 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 10:58 · PVG 18:58 · LAX 02:58 · JFK 05:58
    ♥ Do have faith in what you're doing.