Skip to content

cdbget.1

Manvendra Bhangui edited this page Feb 25, 2024 · 5 revisions

NAME

cdbget - search for records in cdb

SYNOPSIS

cdbget [ -n ] k [s]

DESCRIPTION

cdbget searches for a record with key k in a constant database. The constant database must be readable (and seekable) on cdbget's standard input.

Normally cdbget prints the data in the first record with key k and exits 0. If there is no record with the key k, cdbget exits 100 without printing anything.

If cdbget encounters a read error, write error, or database format error, it complains and exits 111.

Given a numeric s argument, cdbget skips past the first s records with key k, and prints the data in the next record.

The -n arguments append a null character to the key. This can be used to search for records created by cdb-database(8) which appends a null character to the key.

# Get records for domain example.com from /etc/indimail/users/cdb
$ cdbget '!example.com-' < /etc/indimail/users/cdb  |cat -e;echo
example.com^@555^@555^@/var/indimail/domains/example.com^@-^@

# Get authentication api token for entry 'gmail' in
# the cdb file /etc/indmail/control/remote_auth.cdb
$ cdbget -n '!gmail' < /etc/indimail/control/remote_auth.cdb |cat -e;echo
mbhangui@gmail.com wwwwxxxxyyyyzzzz AUTH_SMTP=PLAIN

SEE ALSO

cdbgetm(1), cdbmake(1), cdbdump(1), cdbmake-12(1), cdbmake-sv(1),

Clone this wiki locally