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 as finding a 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 will need to do the following:
Understand the error message and find out what is the problem 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 `"'
These messages inform the user about the line numbers of script which contain errors.
Correct the issue or problematic part of code. We may have to read the line as well as look backward from this line number for any possible reason for the error.