Debugging bash scripts.

Liam Proven lproven at gmail.com
Mon Feb 18 10:49:40 UTC 2019


On Sat, 16 Feb 2019 at 19:10, Ralf Mardorf via ubuntu-users
<ubuntu-users at lists.ubuntu.com> wrote:

>  a bash script
> is "just" a set of rules to run programs.

I think that is not fair or accurate.

I have not looked into the question of whether Bash is
Turing-complete, but it is a proper programming language, with
variables, branches (conditional execution), and looping.

As such, it's as prone to bugs as any other language.

The point I might agree with you on is that, in my very limited
experience, the use of a separate debugger tool is something mainly
used with compiled languages, where you are trying to work out what is
going wrong with a binary executable. A sort of "black box".

In interpreted languages, debugging can consist of pausing the
program, looking at variable values, maybe modifying them, resuming,
jumping to a different execution point, test-running fragments of
code, etc. All this is hard or impossible to do in compiled languages.
That is why they have separate debuggers.

-- 
Liam Proven - Profile: https://about.me/liamproven
Email: lproven at cix.co.uk - Google Mail/Hangouts/Plus: lproven at gmail.com
Twitter/Facebook/Flickr: lproven - Skype/LinkedIn: liamproven
UK: +44 7939-087884 - ČR (+ WhatsApp/Telegram/Signal): +420 702 829 053




More information about the ubuntu-users mailing list