6

I'll love something like Microsoft Visual Studio's line-by-line debugging in bash, with current variables values and so.

Is there any tool or way to do it? set -x and set -v are nice but not perfect.

user123444555621
  • 140,446
  • 26
  • 108
  • 123
emi
  • 607
  • 1
  • 5
  • 18
  • see http://stackoverflow.com/questions/951336/how-to-debug-a-bash-script – Piccolo Feb 15 '13 at 06:24
  • Already seen. Doesn't covers line-by-line debugging, which is the whole point here. I've already searched alot and found nothing, which is why I came to SO. – emi Feb 15 '13 at 06:26
  • 3
    No, the `set -x` (and `-n` and `-v`) options are basically what's available. – Jonathan Leffler Feb 15 '13 at 06:41
  • 2
    The linked question also refers [Bash Debugger](http://bashdb.sourceforge.net/) which is what you are looking for. – bsravanin Feb 28 '13 at 15:21

2 Answers2

6

See bashdb.

If it's installed on your system, see man bashdb.

If it's not installed, see http://bashdb.sourceforge.net

aks
  • 2,188
  • 1
  • 15
  • 14
1

Yes. Use "bashdb" from http://bashdb.sourceforge.net/

Latest version at time of writing http://sourceforge.net/projects/bashdb/files/bashdb/4.2-0.8/

If you are on a Mac (like I was) then you might need to install the GNU version of Bash.

I did that using "MacPorts" http://www.macports.org/

Once you have MacPorts...

port install bash

Then follow the instructions to

./configure (in bashdb unpacked directory)

make

sudo make install

Then add the folder where bashdb can be found in your PATH

Community
  • 1
  • 1
Andrew Mackenzie
  • 5,219
  • 5
  • 45
  • 64