Error Checking and Handling

In this chapter, we will describe how we can check for errors and handle them gracefully. We will start by explaining the exit status concept, followed by a number of functional checks with the test command. After that, we will start using shorthand notation for test command. The next part of this chapter is dedicated to error handling: we will use if-then-exit and if-then-else to handle simple errors. In the final part of this chapter, we will present some ways in which we can prevent errors from occurring in the first place, since prevention is better than remediation.

The following commands will be introduced in this chapter: mktemp, true, and false.

The following topics will be covered in this chapter:

  • Error checking
  • Error handling
  • Error prevention
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.247.159