3.2 Command files

A command file for the BASH debugger is a file of lines that are the BASH debugger commands. Comments (lines starting with #) may also be included. An empty line in a command file does nothing; it does not mean to repeat the last command, as it would from the terminal.

When you start the BASH debugger, it automatically executes commands from its init files, normally called .bashdbinit2. During startup, the BASH debugger does the following:

  1. Reads the init file (if any) in your home directory3.
  2. Processes command line options and operands.
  3. Reads the init file (if any) in the current working directory.
  4. Reads command files specified by the ‘-x’ option.

The init file in your home directory can set options (such as ‘set complaints’) that affect subsequent processing of command line options and operands. Init files are not executed if you use the ‘-x’ option (see bashdb script options).

On some configurations of the BASH debugger, the init file is known by a different name (these are typically environments where a specialized form of the BASH debugger may need to coexist with other forms, hence a different name for the specialized version’s init file). These are the environments with special init file names:

You can also request the execution of a command file with the source command:

source filename

Execute the command file filename.

The lines in a command file are executed sequentially. They are not printed as they are executed. If there is an error, execution proceeds to the next command in the file.


Footnotes

(2)

The DJGPP port of the BASH debugger uses the name bashdb.ini instead, due to the limitations of file names imposed by DOS filesystems.

(3)

On DOS/Windows systems, the home directory is the one pointed to by the HOME environment variable.