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

关于 grep,awk,sed 的 bash 问题

  •  
  •   tamamaxox · Apr 3, 2014 · 2521 views
    This topic created in 4409 days ago, the information mentioned may be changed or developed.
    在命令行中print出的信息中,如何获取 delay 后面的 1.00 , 0.10 这个数字,并且,在没有delay的行里沿用上面一下的数字。不带s。

    。。。嗯,感觉好复杂。

    disposal asis delay 1.00s
    disposal asis
    disposal asis
    disposal asis
    disposal asis
    disposal asis
    disposal asis
    disposal asis delay 1.00s
    disposal asis delay 0.10s
    disposal asis delay 0.10s
    disposal asis delay 0.10s
    1 replies    1970-01-01 08:00:00 +08:00
    kfll
        1
    kfll  
       Apr 3, 2014   ❤️ 1
    | awk '{if ($4) a=$4; printf "%.2f\n",a}'
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5550 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 06:41 · PVG 14:41 · LAX 23:41 · JFK 02:41
    ♥ Do have faith in what you're doing.