给定一个带有绝对形式时间戳的普通文本格式的行式日志文件,是否有任何方便的工具可以将它们转换为相对时间间隔?
例如
2019-01-11 19:31:35 UTC LOG: restored log file "0000000A00000299000000B8" from archive
2019-01-11 19:33:44 UTC LOG: restored log file "0000000A.history" from archive
2019-01-11 19:33:44 UTC LOG: redo starts at 299/B8548220
到
2019-01-11 19:31:35 UTC LOG: restored log file "0000000A00000299000000B8" from archive
+00:02:09 LOG: restored log file "0000000A.history" from archive
+00:00:00 LOG: redo starts at 299/B8548220
我知道我可以毫不费力地写一些东西。但这肯定是一个很常见的需求,以至于在 coreutils/textutils 中可以方便地捆绑一些东西,或者很容易地 apt/yum-able?