MAKEDBM(1M) — Series 300 Only
NAME
makedbm − make a Yellow Pages database
SYNOPSIS
/usr/etc/yp/makedbm [ -i yp_input_file ] \
[ -o yp_output_name ] [ -d yp_domain_name ] \
[ -m yp_master_name ] infile outfile
/usr/etc/yp/makedbm -u database_name
DESCRIPTION
The makedbm command generates databases (maps) for the Yellow Pages (YP) from infile. A database created by makedbm consists of two files: outfile.pag and outfile.dir. A makedbm database contains records called dbm records composed of key-value pairs.
Each line of infile is converted to a single dbm record; all characters up to the first tab or space form the key, and the remainder of the line is the value. If a value read from infile ends with \, the value for that record is continued onto the next line. The YP clients must interpret the pound character (#) (i.e., makedbm does not treat the # as if it precedes a comment). If infile is a dash (−), the standard input is read.
The makedbm command always generates a special dbm record with the key YP_LAST_MODIFIED, whose value is the time of last modification of infile (or the current time, if infile is −). This value is also known as the order number of a map, and yppoll(1M) prints it for a specified YP map.
Another special dbm record always created by makedbm has the key YP_MASTER_NAME. Its value is usually the host name retrieved by gethostname(2); however, the -m option can be used to specify a different value.
Options
−i Create a special dbm record with the key YP_INPUT_FILE and the value yp_input_file.
−o Create a special dbm record with the key YP_OUTPUT_NAME and the value yp_output_name.
−d Create a special dbm record with the key YP_DOMAIN_NAME and the value yp_domain_name.
−m Replace the value of the special dbm record whose key is YP_MASTER_NAME with yp_master_name.
−u Undo the database_name (i.e., write the contents of database_name to the standard output), one dbm record per line. A single space separates each key from its value.
EXAMPLES
Shell scripts can be written to convert ASCII files such as /etc/netgroup to the key-value form used by makedbm. For example,
#!/bin/sh
/bin/awk ’BEGIN { FS = ":" } { print $1, $0 }’ \
/etc/netgroup | \
makedbm - netgroup
converts the /etc/netgroup file to a form that is read by makedbm to make the YP map netgroup. The keys in the database are netgroup(4) names, and the values are the remainders of the lines in the /etc/netgroup file.
AUTHOR
Sun Microsystems, Inc.
SEE ALSO
domainname(1), ypinit(1M), ypmake(1M), yppoll(1M), gethostname(2), netgroup(4), ypfiles(4).
INTERNATIONAL SUPPORT
8-bit data, 8-bit file names, messages
Hewlett-Packard Company — May 11, 2021