Skip to main content

newold

Print only new values to stdout, or those that weren't seen in a while.

Usage

In order to allow old values, newold requires a database to store the values last seen time. You can specify the database file with --db parameter or NEWOLD_DB environment variable.

Here is an usage example:

$ cat /tmp/inputs.txt
one
two
three
$ # new values are printed
$ cat /tmp/inputs.txt | newold --db /tmp/in.db
one
two
three
$ # values are not printed
$ cat /tmp/inputs.txt | newold --db /tmp/in.db
$ sleep 5
$ # values older than 4 seconds are printed
$ cat /tmp/inputs.txt | newold --db /tmp/in.db --seconds 4
one
two
three
$ echo four >> /tmp/inputs.txt
$ # new values are printed
$ export NEWOLD_DB=/tmp/in.db
$ cat /tmp/inputs.txt | newold
four

Without a database only new values are printed to stdout. This behaves like anuniq command that doesn't require the lines to be ordered:

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

Release files for newold 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for newold 0.0.2
File Size Uploaded
newold-0.0.2.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for newold 0.0.2
File Interpreter ABI Platform
newold-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 32.2 kB

Release files / newold-0.0.2.tar.gz

Download URL newold-0.0.2.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
19897a73a1f9b2e5e9f20eb73772f1592ca2191f447b3bcc582fe9a7665ffa51
BLAKE2b-256 checksum
How to use checksums
7d2687f49af61bfd689cbfd5f987f6de6940a4ebe122537c7c48488f76261221
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / newold-0.0.2-py3-none-any.whl

Download URL newold-0.0.2-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a9585a9ddd2361678800e66bf49c23b4a70a2bfecf28abd3e7db7986c1742949
BLAKE2b-256 checksum
How to use checksums
46ae2cdd6126eca61c776c64ef188821f9a08e19de1ffe9fb85f9c4e98a7d383
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page