Debugging

In the very old days of computer technology, the initial problems with computers were due to real insects. Due to this, fault finding was later called finding the bug. Therefore, the process of finding and fixing the problems in computers was called debugging.

The process of debugging involves the following:

  • Finding out what has gone wrong
  • Fixing the problem

In the actual debugging process, you need to do the following:

  • Understand the error message and find out what the problem is with the script.
  • Find the error location in the script.
  • Locate the line number from the error message. The following are a few error messages:
    • debug_sp: line 11: [7: command not found]
    • file: line 6: unexpected EOF while looking for matching `"'

Get Learning Linux Shell Scripting - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.