Starting refdbc

To start an interactive session, run refdbc with the command:

refdbc [-c pager] [-d database] [-e log-destination] [-g deffile] [-G CSS-file] [-h] [-i IP-address] [-l log-level] [-L log-file] [-p port] [-q] [-T time] [-u name] [-v] [-V] [-w password]

Unless you specify a password in a configuration file or on the command line, refdba will ask you for a password before you can proceed. refdbc will then display a prompt and wait for you to enter commands:

refdbc:

To run a refdbc command from the command line, use:

refdbc [-c pager] {-C command-name} {-d database} [-e log-destination] [-g deffile] [-G CSS-file] [-h] [-i IP-address] [-l log-level] [-L log-file] [-p port] [-q] [-T time] [-u name] [-w password]

This will run the command whose name is specified with the -C switch and return to the command line. In this mode, refdbc can read the input for certain commands from stdin. Any additional command-line options that the internal command recognizes can be specified on the command line. To find out which options you can use, see the command descriptions below.

Tip: If you prefer to just run the commands like addref on the command line, you can (if your shell supports this) create aliases like:

alias addref='refdbc -C addref'

This works in bash and would go into your .bashrc. You can then add references to your database with the following command at the shell prompt:

~# addref -d foo mydata.ris

Remember that you don't have to specify all command-line options each time if you define the values in .refdbcrc.

Use the -d option to specify the database that you want to work with. In an interactive session you can also set and change the default database with the selectdb command

The -g option can be used to add some default fields to all references that are added or updated. The argument deffile is the filename of a RIS file containing these additional fields. refdbc first tries the filename as is, so it should be a valid relative or absolute path. If the file is not found, refdb looks for the file in $HOME/. The command aborts if the file cannot be found.

Use the -G option to specify the URL of a Cascading Style Sheets (CSS) file. This file will be used to customize the HTML output of the getref command. The URL can be either a local path (e.g. refdb.css, /home/myname/custom.css) or the web address of a file on a web server (e.g. http://www.mycomp.com/refdb.css).

The purpose of all other command-line switches is explained in Common command-line options.

Note: If you want to run refdbc unattended in batch-mode from a script, you should make sure that you do not specify a pager or a pipe command for an interactive program for the output. This would block the script until you hit a button. To this end you can add the -c stdout option to the command line to disable any pipe or pager commands that you may have in the .refdbrc file.

You may also want to redirect the stderr output to a file for logging purposes.

The exit code is 0 if all went fine. It will be 1 if the command (when run in batch mode) or the last command (when run in interactive mode) returned an error, or if there was a general error condition during startup like a lack of available memory.