Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

CodeSignal

Bash Script Error Handling

via CodeSignal

Overview

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.

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

Reviews

Start your review of Bash Script Error Handling

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.