Debugging bash scripts.

Mike Marchywka marchywka at hotmail.com
Mon Feb 18 10:59:24 UTC 2019


>_________________________________
>From: ubuntu-users <ubuntu-users-bounces at lists.ubuntu.com> on behalf of Liam Proven <lproven at gmail.com>
>Sent: Monday, February 18, 2019 5:49 AM
>To: Ubuntu user technical support, not for general discussions
>Subject: Re: Debugging bash scripts.
>
>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".
>

>From what I have observed, it is used different than say javascript
for which browsers have debuggers and it is not similar to say BASIC.
I guess personally just longer error messages would help with bash per
se but usually these are easy to fix when you find them.
The way bash is normally used you may end up debugging the programs
it invokes more than bash syntax. For that and learning I just
end up dumping everything and making methods for that basics
so you can go into debug mode with a few conditionals.

The condescending c++ errors mesages can be very helpful :) 


fwiw.


>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
>
>--
>ubuntu-users mailing list
>ubuntu-users at lists.ubuntu.com
>Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


note new address
 Mike Marchywka 306 Charles Cox Drive Canton, GA 30115
 2295 Collinworth  Drive Marietta GA 30062.  formerly 487 Salem Woods Drive Marietta GA 30067 404-788-1216 (C)<- leave message 989-348-4796 (P)<- emergency


_______




More information about the ubuntu-users mailing list