1 .\" $NetBSD: db.1,v 1.24 2009/01/28 05:31:18 lukem Exp $
3 .\" Copyright (c) 2002-2009 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Luke Mewburn of Wasabi Systems.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
56 .Op Ar key Op Ar \&.\&.\&.
67 .Op Ar key Op Ar \&.\&.\&.
81 .Op Ar key Ar value Op Ar \&.\&.\&.
85 allows manipulation of
93 has three modes of operation to perform upon
95 .Bl -tag -width "delete" -offset indent
103 is specified, the entire database is displayed.
104 This is the default mode of operation.
110 and keys described in
119 and keys and values described in
121 (in the latter case, entries are separated by
125 There are two mandatory arguments:
127 is the database type; either
133 is the database file to manipulate.
135 Options valid for all modes are:
136 .Bl -tag -width Fl -offset indent
139 Set the endianness of the database.
142 .Bl -tag -width 1n -offset indent -compact
155 Contains a list of keys
156 (for read and delete), or
158 separated keys and values (for write)
159 to be used as arguments to the given mode.
168 Keys are converted to lower case before manipulation.
171 Do not include the NUL byte at the end of the key or value.
175 In read mode, missing keys are not considered to be an error.
181 the result of various operations is suppressed.
184 Control how the items specified by the
192 option-argument is a string specifying
195 The string consists of one or more characters:
196 .Bl -tag -width 2n -offset indent -compact
232 corresponding options for the meaning of these characters,
235 for more detail on the flags.
237 .It Fl U Ar unvisitem
243 option-argument is a character specifying if the key
254 Read mode specific options are:
256 .Bl -tag -width Fl -offset indent
259 Display duplicate entries in
267 Field separator string between key and value.
268 Defaults to a single tab
277 option-argument is a character specifying if the key
289 When encoding items with
291 option also encode characters in
298 .Bd -ragged -offset indent
303 is given, both options are enabled.)
307 Write mode specific options are:
308 .Bl -tag -width Fl -offset indent
311 Create new database, and truncate existing databases.
314 Allow duplicate entries in
322 Input field separator string between key and value used when parsing
324 Defaults to a single space
328 Octal mode of created database.
333 Set the page size of the table to
338 a database-specific default is determined,
339 based on the block-size of the underlying file-system.
344 Overwrite existing entries.
345 If not specified, writing to an existing entry raises an error.
366 .Aq lukem@NetBSD.org .