S6-TAI64NDIFF(1)

NAME
s6-tai64ndiff - show time difference between two TAI64N-timestamped lines

SYNOPSIS
s6-tai64ndiff

DESCRIPTION
s6-tai64ndiff acts as a filter, reading from stdin and writing to stdout. It expects every line of its input to begin with a TAI64N[1] timestamp. It replaces this timestamp with a prefix showing the time difference between this line and the previous line.

s6-tai64ndiff exits 0 when it sees the end of stdin. If there's an unfinished line, s6-tai64ndiff processes it and writes it before exiting.

The prefix it prints is of the form

    [seconds.microseconds]

in decimal. It can be interpreted as a fixed-point decimal number of seconds that elapsed between the timestamp on the previous line and the timestamp on the current line.

If the difference isn't defined, seconds and microseconds are just whitespace. The difference is not defined on the first line of stdin or on non-timestamped lines. Following non-timestamped lines, the difference may not be accurate.

The typical use case of s6-tai64ndiff is to read files that have been filtered through s6-tai64n(1), or log files that have been produced by s6-log(1) with the ‘t’ directive.

The difference is a signed number. Negative numbers probably indicate a backwards clock jump, which is a bad thing to have on a system.

EXIT STATUS

111 Temporary error.

100 Permanent error, such as a misuse.

127 Unable to execute program - not found.

126 Unable to execute program - other reason.

SEE ALSO
s6-basename(1), s6-cat(1), s6-chmod(1), s6-chown(1), s6-clock(1), s6-cut(1), s6-dirname(1), s6-dumpenv(1), s6-echo(1), s6-env(1), s6-expr(1), s6-false(1), s6-format-filter(1), s6-grep(1), s6-head(1), s6-hiercopy(1), s6-linkname(1), s6-ln(1), s6-ls(1), s6-maximumtime(1), s6-mkdir(1), s6-mkfifo(1), s6-nice(1), s6-nuke(1), s6-pause(1), s6-printenv(1), s6-quote(1), s6-quote-filter(1), s6-rename(1), s6-rmrf(1), s6-seq(1), s6-sleep(1), s6-sort(1), s6-sync(1), s6-tail(1), s6-touch(1), s6-true(1), s6-uniquename(1), s6-unquote(1), s6-unquote-filter(1), s6-update-symlinks(1), seekablepipe(1)

[1] https://skarnet.org/software/skalibs/libstddjb/tai.html#timestamp

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-portable-utils/s6-tai64ndiff.html

AUTHORS
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)