© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
J. VarmaPro Bash https://doi.org/10.1007/978-1-4842-9588-5_10

10. Writing Bug-Free Scripts and Debugging the Rest

Jayant Varma1  
(1)
Berwick, VIC, Australia
 

A programmer that has never written a buggy program has either not written any code or is more imaginary than Santa Claus or the Easter Bunny. Bugs are the bane of a programmer’s existence. These range from simple typing errors (causing syntax errors) to more complex bad code to faulty logic. These errors can be fixed, some easily while others can take hours or days to identify, trace, and fix.

At one end of the spectrum are the syntax errors that prevent a script from completing or running at all. These ...

Get Pro Bash: Learn to Script and Program the GNU/Linux Shell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.