#line #cache #seen #repeat #seconds #file #weren-t

app uncached

Only print new lines, or those which weren't seen in a while

1 unstable release

0.1.0 Dec 2, 2023

#2 in #seen

Download history 2/week @ 2024-02-19 14/week @ 2024-02-26 2/week @ 2024-03-11 18/week @ 2024-04-01 52/week @ 2024-04-15

70 downloads per month

AGPL-3.0-only

19KB
183 lines

uncached

Only print new lines, or those which weren't seen in a while

Usage

Without arguments, uncached will erase repeated lines:

$ cat /tmp/inputs.txt
one
two
one
three
uncached$ cat /tmp/inputs.txt | uncached
one
two
three

A cache file can be provided to avoid repeat lines in a period of time:

$ cat /tmp/inputs.txt
one
two
three
$ # new values are printed
$ cat /tmp/inputs.txt | uncached -c /tmp/in.cache
one
two
three
$ # values are not printed
$ cat /tmp/inputs.txt | uncached -c /tmp/in.cache
$ sleep 5
$ # values older than 4 seconds are printed
$ cat /tmp/inputs.txt | uncached -c /tmp/in.cache
one
two
three
$ echo four >> /tmp/inputs.txt
$ # new values are printed
$ cat /tmp/inputs.txt | uncached -c /tmp/in.cache
four

Dependencies

~2.5–3.5MB
~61K SLoC