| 1 | # @(#)README 8.8 (Berkeley) 7/31/94
|
|---|
| 2 |
|
|---|
| 3 | To build this portably, try something like:
|
|---|
| 4 |
|
|---|
| 5 | make PORTDIR="../PORT/MACH"
|
|---|
| 6 |
|
|---|
| 7 | where MACH is the machine, i.e. "sunos.4.1.1".
|
|---|
| 8 |
|
|---|
| 9 | To run the tests, enter "sh run.test". If your system dictionary isn't
|
|---|
| 10 | in /usr/share/dict/words, edit run.test to reflect the correct place.
|
|---|
| 11 |
|
|---|
| 12 | Fairly large files (the command files) are built in this directory during
|
|---|
| 13 | the test runs, and even larger files (the database files) are created in
|
|---|
| 14 | "/var/tmp". If the latter directory doesn't exist, set the environmental
|
|---|
| 15 | variable TMPDIR to a directory where the files can be built.
|
|---|
| 16 |
|
|---|
| 17 | =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|---|
| 18 | The script file consists of lines with an initial character which is
|
|---|
| 19 | the command for that line, or an initial character indicating a key
|
|---|
| 20 | or data entry for a previous command.
|
|---|
| 21 |
|
|---|
| 22 | Legal command characters are as follows:
|
|---|
| 23 |
|
|---|
| 24 | c: compare a record
|
|---|
| 25 | + must be followed by [kK][dD]; the data value in the database
|
|---|
| 26 | associated with the specified key is compared to the specified
|
|---|
| 27 | data value.
|
|---|
| 28 | e: echo a string
|
|---|
| 29 | + writes out the rest of the line into the output file; if the
|
|---|
| 30 | last character is not a carriage-return, a newline is appended.
|
|---|
| 31 | f: set the flags for the next command
|
|---|
| 32 | + no value zero's the flags
|
|---|
| 33 | g: do a get command
|
|---|
| 34 | + must be followed by [kK]
|
|---|
| 35 | + writes out the retrieved data DBT.
|
|---|
| 36 | o [r]: dump [reverse]
|
|---|
| 37 | + dump the database out, if 'r' is set, in reverse order.
|
|---|
| 38 | p: do a put command
|
|---|
| 39 | + must be followed by [kK][dD]
|
|---|
| 40 | r: do a del command
|
|---|
| 41 | + must be followed by [kK] unless R_CURSOR flag set.
|
|---|
| 42 | S: sync the database
|
|---|
| 43 | s: do a seq command
|
|---|
| 44 | + must be followed by [kK] if R_CURSOR flag set.
|
|---|
| 45 | + writes out the retrieved data DBT.
|
|---|
| 46 |
|
|---|
| 47 | Legal key/data characters are as follows:
|
|---|
| 48 |
|
|---|
| 49 | D [file]: data file
|
|---|
| 50 | + set the current data value to the contents of the file
|
|---|
| 51 | d [data]:
|
|---|
| 52 | + set the current key value to the contents of the line.
|
|---|
| 53 | K [file]: key file
|
|---|
| 54 | + set the current key value to the contents of the file
|
|---|
| 55 | k [data]:
|
|---|
| 56 | + set the current key value to the contents of the line.
|
|---|
| 57 |
|
|---|
| 58 | Blank lines, lines with leading white space, and lines with leading
|
|---|
| 59 | hash marks (#) are ignored.
|
|---|
| 60 |
|
|---|
| 61 | Options to dbtest are as follows:
|
|---|
| 62 |
|
|---|
| 63 | -d: Set the DB_LOCK flag.
|
|---|
| 64 | -f: Use the file argument as the database file.
|
|---|
| 65 | -i: Use the rest of the argument to set elements in the info
|
|---|
| 66 | structure. If the type is btree, then "-i cachesize=10240"
|
|---|
| 67 | will set BTREEINFO.cachesize to 10240.
|
|---|
| 68 | -o: The rest of the argument is the output file instead of
|
|---|
| 69 | using stdout.
|
|---|
| 70 | -s: Don't delete the database file before opening it, i.e.
|
|---|
| 71 | use the database file from a previous run.
|
|---|
| 72 |
|
|---|
| 73 | Dbtest requires two arguments, the type of access "hash", "recno"
|
|---|
| 74 | or "btree", and the script name or "-" to indicate stdin.
|
|---|