Learn effective error management in shell scripts. Cover exit statuses, error message redirection, file/directory checks, `trap` command for cleanup, and try-catch mechanisms. Master writing robust scripts that handle errors gracefully and maintain system stability. By course end, you'll create reliable shell scripts for various scenarios.
Overview
Syllabus
- Unit 1: Understanding Exit Statuses
- Observe Exit Statuses in Action
- Update Exit Status Script
- Fix the Error Statuses
- Admin Login Error Handling
- Mastering Shell Script Exit Statuses
- Unit 2: Standard Error and Logging in Shell Scripts
- Observing Error Redirection
- Modifying Error Redirection
- Fix Redirection Bugs
- File Size Error Handling
- Custom Function Error Handling
- Unit 3: File and Directory Error Handling
- Check File and Directory Existence
- Modifying File and Directory Existence
- Check and Create File Paths
- Handling Sensitive Data
- Handling File Copy Errors
- Unit 4: Trap Command and Cleaning Up
- Observing Trap Commands
- Handling Interrupt Trap Signals
- Fix the Cleanup Bug
- Auto-save Error Handling
- System Updates Cleanup