Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphical debugger for bash

Is it there any graphical debugger for bash on mac os x or linux? I mean something in the same fashion that the debugging mode of Visual Studio or Eclipse, where one can stop the program hover the mouse pointer over variables and get instantly values, modify them and go backwards and try modifications without the need to start the program fomr the beginning. I am talking about very long bash scripts

like image 227
Open the way Avatar asked Jun 02 '11 14:06

Open the way


People also ask

How do I debug bash?

The debugging options available in the Bash shell can be switched on and off in multiple ways. Within scripts, we can either use the set command or add an option to the shebang line. However, another approach is to explicitly specify the debugging options in the command-line while executing the script.

What is #/ bin bash?

The shebang, #!/bin/bash when used in scripts is used to instruct the operating system to use bash as a command interpreter. Each of the systems has its own shells which the system will use to execute its own system scripts. This system shell can vary from OS to OS(most of the time it will be bash).

What does set +E do in bash?

Set –e is used within the Bash to stop execution instantly as a query exits while having a non-zero status. This function is also used when you need to know the error location in the running code.


2 Answers

for debugging execute your script with:

bash -x <scriptname>

gui debugger: http://bashdb.sourceforge.net/

like image 200
Ben English Avatar answered Oct 12 '22 13:10

Ben English


Debugger for Bash version 3(Bourne again shell). Plugin for Eclipse. Will only work with shell script editor ShellEd. http://sourceforge.net/projects/basheclipse/

like image 24
avkosinsky Avatar answered Oct 12 '22 12:10

avkosinsky