manpagez: man pages & more
info gdbm
Home | html | info | man

File: gdbm.info,  Node: shell,  Prev: invocation,  Up: gdbmtool

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:

Sequence               Replaced with
\a                     Audible bell character (ASCII 7)
\b                     Backspace character (ASCII 8)
\f                     Form-feed character (ASCII 12)
\n                     Newline character (ASCII 10)
\r                     Carriage return character (ASCII
                       13)
\t                     Horizontal tabulation character
                       (ASCII 9)
\v                     Vertical 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 (*note Command Line Editing: (readline)Command Line Editing.).

* Menu:

* variables::      shell variables.
* commands::       shell commands.
* definitions::    how to define structured data.
* startup files::

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.