Crates.io | uncached |
lib.rs | uncached |
version | 0.1.0 |
source | src |
created_at | 2023-12-02 16:45:34.781424 |
updated_at | 2023-12-02 16:45:34.781424 |
description | Only print new lines, or those which weren't seen in a while |
homepage | |
repository | https://gitlab.com/Zer1t0/uncached |
max_upload_size | |
id | 1056256 |
size | 56,496 |
Only print new lines, or those which weren't seen in a while
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