1
0
Files
2022-09-29 17:59:04 +03:00

105 lines
2.3 KiB
Plaintext

.TH makemdbm 1M
.SH NAME
makemdbm, makedbm \- make an NIS mdbm file
.SH SYNOPSIS
.nf
\f3makemdbm\f1 [ \f3\-b\f1 ] [ \f3\-l\f1 ] [ \f3\-i\f1 \f2yp_input_file\f1 ] \c
[ \f3\-o\f1 \f2yp_output_name\f1 ]
[ \f3\-d\f1 \f2yp_domain_name\f1 ] [ \f3\-m\f1 \f2yp_master_name\f1 ] \c
\f2infile\f1 \f2outfile\f1
\f3makemdbm\f1 [ \f3\-u\f1 \f2mdbmfilename\f1 ]
.fi
.SH DESCRIPTION
.I makemdbm
takes
.I infile
and converts it to a file in
.IR mdbm (3B)
format.
Each line of the input file is converted to a single
.I mdbm
record.
All characters up to the first tab or space form the key,
and the rest of the line is the data.
If a line ends with \e,
then the data for that record is continued on to the next line.
It is left for the clients of the network information service (NIS)
to interpret #;
.I makedbm
does not itself treat it as a comment character.
.I infile
can be
.BR \- ,
in which case standard input is read.
.LP
.I makemdbm
is meant to be used in generating
.I mdbm
files for NIS.
It generates a special entry with the key
.IR yp_last_modified ,
which is the date of
.I infile
(or the current time, if
.I infile
is
.BR \- ).
.SH OPTIONS
.TP
.B \-l
Convert all uppercase characters in the keys to lowercase.
.TP
.B \-i \f2yp_input_file\f1
Create a special entry with the key
.IR YP_INPUT_FILE .
.TP
.B \-o \f2yp_output_name\f1
Create a special entry with the key
.IR YP_OUTPUT_NAME .
.TP
.B \-d \f2yp_domain_name\f1
Create a special entry with the key
.IR YP_DOMAIN_NAME .
.TP
.B \-m \f2yp_master_name\f1
Create a special entry with the key
.IR YP_MASTER_NAME .
If no master hostname is specified,
.I yp_master_name
is set to the local hostname.
.TP
.B \-u \f2mdbmfilename\f1
Undo a
.I mdbm
file.
That is, print out a
.I mdbm
file one entry per line,
with a single space separating keys from values.
.SH EXAMPLE
It is easy to write shell scripts
to convert standard files such as
.I /etc/passwd
to the key value form used by
.IR makemdbm .
For example,
.Ex
#!/usr/bin/awk -f
BEGIN { FS = ":"; OFS = "\et"; }
{ print $1, $0 }
.Ee
takes the
.I /etc/passwd
file and converts it to a form that can be read by
.I makemdbm
to make the NIS file
.IR passwd.byname .
That is, the key is a username,
and the value is the remaining line in the
.I /etc/passwd
file.
.SH SEE ALSO
yppasswd(1),
nis(1M),
mdbm(3B).