Is there a GUI debugger for shell scripts
Download ShellEd eclipse plugin (update site didn't work for me) which allows editing bash scripts. Install this via Help -> Install new software -> Add -> Archive
.
Download basheclipse and extract the contents to your eclipse plugins
directory plugin.
Restart eclipse. Create a new Eclipse project BashTest
.
Add a file myscript.sh
to the project:
#! /bin/bash
. _DEBUG.sh
echo 'kshitiz'
echo 'This is a test'
x=1
y=3
z=3
Add _DEBUG.sh
to your project (Its in the downloaded zip for basheclipse
).
Go to Run -> Debug configurations
and create a new configuration under Bash script
category. Select myscript.sh
.
Then click Debug
. Open Debug
perspective.
Go to Window -> Preferences -> Shell script -> Interpreters
and ensure that interpreter is /bin/bash
. For me the default was /bin/dash
.
Set a breakpoint in the script. For some reason the right click menu does not show the option to set the breakpoint but Ctrl+Shift+B
should work.
Run the script Run -> Run as -> Run shell script
. The breakpoint will hit but it won't be able to find your script source (wierd eh!). Just click Select Bash script
and select myscript.sh
.
Now you can step through the code and analyze the variables:
If you are a GNU Emacs user, you can use the emacs-package realgud.