Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
a minimal bash debugger
Shell
branch: master

readme.markdown

minimal-bash-debug

as its name implies: this is your minimal bash debugger. minimal-bash-debug is simple to implement and to use. just by adding a short bash snippet and it's minimal syntax.

there are a lot of techniques for bash scripters to debug thier code and here's mine.

install

cd path/to/your/bashscript
wget http://github.com/noqqe/minimal-bash-debug/raw/master/.minimal-bash-debug 
chmod +x .minimal-bash-debug    

usage

just ad:

debug() {
  debug=2 # set debug level 0|1|2|3
  if [ -x .minimal-bash-debug ]; then
  ./.minimal-bash-debug $debug $1 $2 "$3"
  fi
}

to your bashscript and use:

debug 1 echo "variable foo is $foo"
debug 3 syslog "variable bar is $bar"

debugging

you could print your debug message to syslog or just to your screen..or both. switch on/off your debugging easily. please see example.sh for further informations.

Something went wrong with that request. Please try again.