|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
| Summary of the BASH Debugger | Pipes in Loops | Reference | |||
| Arithmetic expressions | Comparison operators | Loops in Shell | bash Tips and Tricks | Shell Humor | Etc |
I would recommend to check syntax of the bash script before using the debugger. You can use this by using option "-n", for example
bash -n your_script.sh
Usage of bash db is very simple. The essentials are:
kill command.
kill -9 can be used in cases where quit doesn't
work. -h | --help -V | --version -A | --annodate level -c | --command cmd -B | --basename -n | --nx | --no-init -q | --quiet -t | --terminal | --tty tty -x | --eval-command -L | --library directory ../lib/bashdb relative to the place
that the bashdb script is located. For example if bashdb is located in
/usr/local/bin/bashdb, the default library location will be
/usr/local/lib/bashdb which may or may not exist. If it
doesn't you'll get an error when you run bashdb. Only if the default
location is incorrect, should you need to use the -L
option. -T | --tempdir directory
_Dbg_debugger |
Let's show an example of that. We'll even do it under a condition:
for ((i=1; i<=10; i++)) ;
(( 5 == i )) && { _Dbg_debugger }
date=$(date)
echo "$date"
sleep 2
done
|
help. You can use help (abbreviated
h) with no arguments to display a short list of named classes of
commands:
bashdb<0> help Available commands: / debug enable help next show step- untrace alias delete eval history print signal tbreak up break disable examine info pwd skip trace watch commands display file kill quit source tty where condition down frame list restart step unalias continue edit handle load set step+ undisplay |
There are also two front-ends available as well. One can also enter the debugger
inside emacs via the command M-x bashdb after loading Emacs' Grand
Unified Debugger, gud. See Using the
BASH debugger from GNU Emacs. And there is support in a
DDD for bash.
Basdb documentation has several examples on how to use bashdb. See Summary of the BASH Debugger
The Ubuntu repository contains a package for bashdb
There is also a new version, bashdb 4.0, which has been tested on bash 4.0 alpha
as well as bash 3.2.x.
There are also similar debuggers for zsh and ksh; these are called zshdb and kshdb
respectively. But in contrast to bashdb, both require fairly new releases (ksh93t
from Nov 4 or zshdb 4.3.6-dev-0 or greater) .
As with bashdb, zshdb in available as a source package in Debian. To get releases
from sources though go to the same place:
https://sourceforge.net/project/showfiles.php?group_id=61395
BASH Debugger Debugging with the BASH debugger
rpmseek.com - The search engine for Linux rpm and Debian packages
RPM Search bash-3.0-18.x86_64.rpm
bash rpm build for : Fedora 3. For other distributions
click here. ... bashdb
/usr/share/doc/bash-3.0/bashdb/bashdb.el /usr ... ps There
is 253 files more in these ...
rpm.pbone.net/index.php3/stat/ 4/idpl/1562422/com/bash-3.0-18.x86_64.rpm.html
- 15k - Supplemental Result -
RPM Search bash-3.0-24.i386.rpm
bash rpm build for : Fedora Other ... bash-3.0/bashdb/bashdb /usr/share/doc/bash-3.0/
bashdb/bashdb.el /usr ... bash-3.0/builtins.ps There is 253 files more in these RPM.
rpm.pbone.net/index.php3/stat/ 4/idpl/1546533/com/bash-3.0-24.i386.rpm.html - 16k - Supplemental Result -Cached - Similar pages
[ More results from rpm.pbone.net ]
bash-doc-3.0-67125cl.i386 RPM
... 26 01:55:29 (42311) - Include the pgrp_sync.patch from
the fedora bash src.rpm,
this was ... doc-3.0/bashbug.ps /usr/share/doc/bash-doc-3.0/bashdb
/usr/share ...
rpmfind.net/linux/RPM/conectiva/snapshot/ i386/RPMS.doc/bash-doc-3.0-67125cl.i386.html
- 16k - Supplemental Result -
bash-3.0-24.ia64 RPM
From Fedora Core Development for ia64. ... Size: 6002587, Source RPM: bash-3.0-24.src.
rpm. ... usr/share/doc/bash-3.0/bashbug.ps /usr/share/doc/bash-3.0/bashdb /usr/share ...
rpmfind.net/linux/RPM/fedora/ development/ia64/bash-3.0-24.ia64.html - 34k - Supplemental Result -Cached - Similar pages
[ More results from rpmfind.net ]
bash-2.05b-31.i386 RPM
De Fedora Core 1 - i386. ... Tamaño: 4406854, RPM
del código fuente : bash-2.05b-31.src.
rpm. ... doc/bash-2.05b/bashbug.ps /usr/share/doc/bash-2.05b/bashdb
/usr/share ...
rpmfind.rediris.es/rpm2html/ fc1-i386/bash-2.05b-31.i386.html
- 30k - Supplemental Result -
bash-2.05b-38.i386 RPM
De Fedora Core 2 - i386. ... Tamaño: 4394487, RPM del código fuente : bash-2.05b-38.src.
rpm. ... doc/bash-2.05b/bashbug.ps /usr/share/doc/bash-2.05b/bashdb /usr/share ...
rpmfind.rediris.es/rpm2html/ fc2-i386/bash-2.05b-38.i386.html - 31k - Supplemental Result -Cached - Similar pages
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Last modified: January 14, 2010