If we follow certain good practices, then we will face errors. Even if errors are found, these will be easier to debug:
- Clear and tidy the script.
- Try to properly indent the programming constructs, such as if, for, while, and other similar loops:
if [ $rate -lt 3 ] then echo "Sales tax rate is too small." fi
- Do not put multiple commands on the same line by using ;.
- Use descriptive variable names, such as salary, instead of sa. In very complex Shell scripts, non-descriptive variable names will make debugging very difficult.
- Store the file and directory names in variables instead of typing them again and again. If any change is required in the directory path, then making the change in the variable at one ...