Debug Your Shell Scripts With bashdb | Linux Today

Debug Your Shell Scripts With bashdb

Written By
Web Webster
Web Webster
Nov 25, 2008

“The Ubuntu Intrepid repository contains a package for bashdb,
but there is no special bashdb package in the openSUSE 11 or Fedora
9 repositories. I built from source using version 4.0-0.1 of bashdb
on a 64-bit Fedora 9 machine, using the normal ./configure; make;
sudo make install commands.

“You can start the Bash Debugger using the bash –debugger
foo.sh syntax or the bashdb foo.sh command. The former method is
recommended except in cases where I/O redirection might cause
issues, and it’s what I used. You can also use bashdb through ddd
or from an Emacs buffer.

“The syntax for many of the commands in bashdb mimics that of
gdb, the GNU debugger. You can step into functions, use next to
execute the next line without stepping into any functions, generate
a backtrace with bt, exit bashdb with quit or Ctrl-D, and examine a
variable with print $foo. Aside from the prefixing of the variable
with $ at the end of the last sentence, there are some other minor
differences that you’ll notice. For instance, pressing Enter on a
blank line in bashdb executes the previous step or next command
instead of whatever the previous command was.

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.