DBMEDIT(ADM) UNIX System V
Name
dbmedit - edit the mmdf database file
Syntax
/usr/bin/dbmedit [-v] [-ddatabase] [cmd...]
Description
The dbmedit command lets you edit the dbm(S) database used
by MMDF. Use this command for quick and simple changes to
the database or with careful use of setuid programs to make
controlled changes on behalf of users. For example, a
forwardmail command (that you create) might use dbmedit to
change a user's entry in the dbm database after changing the
mail forwarding alias file.
The -v option may be used to get a verbose description of
the program's activities.
The -d option may be used to specify an alternate database.
The default is given by the ``tbldbm'' configuration
variable or by the MDBM /usr/mmdf/mmdftailor variable.
If no arguments are given to dbmedit, then the program goes
into an interactive mode, and prompts the user for each
command. Otherwise the arguments are taken as one command.
Commands in dbmedit refer to keys, tables, and values.
Tables (see tables(F)) are hashed into the database using
dbmbuild(ADM). (Tables that refer to domain name servers are
not part of the database). The keys appear on the left side
of the tables and the values on the right side. In general,
only the first occurence of a value for a given key/table
pair is significant. For example, the table entries:
table1:
key1: val1
key2: val2
table2:
key1: val3
key1: val4
get hashed into the following database entries:
key1 table1 val1
key1 table2 val3
key1 table2 val4
key2 table1 val2
(In the current implementation, the database is keyed on
only the key, and table/value pairs are encoded in the data
portion. This is likely to change but will not affect this
or any other program.)
The command lines in interactive mode are parsed using the
standard MMDF string-to-argument routines so the same
quoting and escape conventions are used. For example, if
you want double-quotes or spaces in the value, they must be
escaped with a backslash or the string must be quoted (for
spaces).
The commands are:
print key [table]
Print the value of the key/table pair. If the
table is omitted, then print the value of any table
entry with this key.
add key table value
Add a key/table entry with the given value. In
verbose mode, a warning message is printed if the
given key/table pair already has a value in the
database.
delete key [table [value]]
Delete the values for the specified key. If a
table is specified, delete only the values for the
specified key/table pair. If a value is also
specified, delete only entries for the pair with
that value. It is an error to try to delete
something which does not appear in the database as
specified.
change key table [oldvalue] newvalue
Change the value of the specified key/table pair to
newvalue. If oldvalue is specified, change the
entry matching that value. Otherwise, change the
value of the first occurence or add a new key/table
pair if none already exists.
help
Give a brief summary of the commands
quit
Exit the program.
All commands may be shortened to their first character only.
If the wrong number of arguments is given to a command, a
``Usage:'' message is displayed. This program may be used
while MMDF processes are running. All changes are made in
real time; no temporary copy of the database is made while
editing takes place.
Files
$(tbldbm).{dir,pag} - the mmdf database
See Also
tables(F), dbmbuild(ADM)
Credit
This utility was written by Phil Cockcroft.
MMDF was developed at the University of Delaware and is used
with permission.
(printed 7/26/90) DBMEDIT(ADM)