Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

newold-0.0.2.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

newold-0.0.2-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file newold-0.0.2.tar.gz.

File metadata

  • Download URL: newold-0.0.2.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for newold-0.0.2.tar.gz
Algorithm Hash digest
SHA256 19897a73a1f9b2e5e9f20eb73772f1592ca2191f447b3bcc582fe9a7665ffa51
MD5 820f5b9aad6ac57a10af52c681d9195d
BLAKE2b-256 7d2687f49af61bfd689cbfd5f987f6de6940a4ebe122537c7c48488f76261221

See more details on using hashes here.

File details

Details for the file newold-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: newold-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for newold-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a9585a9ddd2361678800e66bf49c23b4a70a2bfecf28abd3e7db7986c1742949
MD5 8e2e9fe3e5871e2f2f6d536eb75c0624
BLAKE2b-256 46ae2cdd6126eca61c776c64ef188821f9a08e19de1ffe9fb85f9c4e98a7d383

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page