Previous: , Up: gdbmtool   [Contents][Index]

24.2 gdbmtool interactive mode

After successful startup, gdbmtool starts a loop, in which it reads commands from the standard input, executes them and prints results on the standard output. If the standard input is attached to a console, gdbmtool runs in interactive mode, which is indicated by its prompt:

gdbmtool> _

The utility finishes when it reads the quit command (see below) or detects end-of-file on its standard input, whichever occurs first.

A gdbmtool command consists of a command verb, optionally followed by arguments, separated by any amount of white space and terminated with a newline or semicolon. A command verb can be entered either in full or in an abbreviated form, as long as that abbreviation does not match any other verb. For example, co can be used instead of count and ca instead of cache.

Any sequence of non-whitespace characters appearing after the command verb forms an argument. If the argument contains whitespace or unprintable characters it must be enclosed in double quotes. Within double quotes the usual escape sequences are understood, as shown in the table below:

SequenceReplaced with
\aAudible bell character (ASCII 7)
\bBackspace character (ASCII 8)
\fForm-feed character (ASCII 12)
\nNewline character (ASCII 10)
\rCarriage return character (ASCII 13)
\tHorizontal tabulation character (ASCII 9)
\vVertical tabulation character (ASCII 11)
\\Single slash
\"Double quote

Table 24.1: Backslash escapes

In addition, a backslash immediately followed by the end-of-line character effectively removes that character, allowing to split long arguments over several input lines.

Command parameters may be optional or mandatory. If the number of actual arguments is less than the number of mandatory parameters, gdbmtool will prompt you to supply missing arguments. For example, the store command takes two mandatory parameters, so if you invoked it with no arguments, you would be prompted twice to supply the necessary data, as shown in example below:

gdbmtool> store
key? three
data? 3

However, such prompting is possible only in interactive mode. In non-interactive mode (e.g. when running a script), all arguments must be supplied with each command, otherwise gdbmtool will report an error and exit immediately.

If the package is compiled with GNU Readline, the input line can be edited (see Command Line Editing in GNU Readline Library).

Previous: , Up: gdbmtool   [Contents][Index]