📘 Bash Scripting Curriculum – Focused on Core Capabilities (WordPress Server Context)
1. Bash Fundamentals & Environment Setup​
| Module | Capability | Description |
| 1.1 | History & Role of Bash | Understand why Bash is the default Linux shell and its role in automation and scripting. |
| 1.2 | Shell vs Terminal vs Bash | Differentiate shell environments and how Bash interprets commands. |
| 1.3 | Environment Setup | Configure .bashrc, .profile, PATH variables, and aliases. |
| 1.4 | Running Scripts | Execute scripts interactively or non-interactively, with permissions (chmod +x). |
| 1.5 | Shebang (#!) | Specify interpreter path for reliable script execution. |
2. Syntax & Command Structure​
| Module | Capability | Description |
| 2.1 | Command Grouping | Combine commands using {}, ( ), and subshells. |
| 2.2 | Command Chaining | Use ;, &&, and ` |
| 2.3 | Exit Status Codes | Interpret $? to manage success/failure flow. |
| 2.4 | Quoting & Escaping | Manage literal and expanded strings using ", ', and \. |
| 2.5 | Comments | Document scripts with # for readability and maintenance. |
3. Variables & Parameters​
| Module | Capability | Description |
| 3.1 | Variable Declaration | Define and reference user-defined variables. |
| 3.2 | Environment Variables | Manage system variables ($PATH, $HOME, $USER). |
| 3.3 | Positional Parameters | Access arguments passed to scripts ($1, $2, $@). |
| 3.4 | Special Variables | Understand $?, $$, $!, $UID, $RANDOM. |
| 3.5 | Parameter Expansion | Modify or substitute variable content (${var//old/new}). |
4. Input, Output & Redirection​
| Module | Capability | Description |
| 4.1 | Standard Streams | Understand stdin, stdout, and stderr. |
| 4.2 | Redirection Operators | Redirect outputs (>, >>, <, 2>, &>). |
| 4.3 | Piping | Pass output from one command to another using ` |
| 4.4 | Tee Command | Display and write outputs simultaneously. |
| 4.5 | Here Documents & Strings | Use << and <<< for inline input blocks. |
5. Conditional Logic & Flow Control​
| Module | Capability | Description |
| 5.1 | If / Else | Implement branching conditions in scripts. |
| 5.2 | Comparison Operators | Compare integers, strings, and files (-eq, -lt, ==, !=). |
| 5.3 | File & Directory Tests | Use test operators (-f, -d, -r, -w, -x). |
| 5.4 | Case Statements | Simplify multi-branch logic with case ... esac. |
| 5.5 | Exit Control | Use exit, break, and continue effectively. |
6. Loops & Iteration​
| Module | Capability | Description |
| 6.1 | For Loops | Iterate through lists, arrays, or directories. |
| 6.2 | While & Until Loops | Perform repeated actions based on conditions. |
| 6.3 | Loop Control | Manage loop execution using break and continue. |
| 6.4 | Nested Loops | Build structured repetition for complex logic. |
| 6.5 | Practical Use | Automate repetitive system or file operations. |
7. Functions & Modularity​
| Module | Capability | Description |
| 7.1 | Declaring Functions | Create reusable blocks of code. |
| 7.2 | Function Arguments | Access and handle parameters inside functions. |
| 7.3 | Local Variables | Restrict variable scope with local. |
| 7.4 | Return Values | Manage success or error codes from functions. |
| 7.5 | Sourcing Files | Reuse shared functions with source or .. |
8. String & Text Operations​
| Module | Capability | Description |
| 8.1 | String Manipulation | Extract, slice, and modify strings. |
| 8.2 | Pattern Matching | Use wildcards (*, ?) and regex with [[ ]] or =~. |
| 8.3 | Parameter Substitution | Apply ${var#}, ${var%}, ${var//} expansions. |
| 8.4 | String Comparison | Compare and test string equality or length. |
| 8.5 | Case Conversion | Transform case (${var^^}, ${var,,}). |
9. File & Directory Operations​
| Module | Capability | Description |
| 9.1 | File Tests | Check existence and type using test operators. |
| 9.2 | Create / Remove | Automate file or folder creation/deletion (touch, mkdir, rm). |
| 9.3 | Copy / Move | Manage data relocation using cp and mv. |
| 9.4 | Symlinks | Create or manage symbolic links with ln -s. |
| 9.5 | Path Operations | Manipulate file paths using basename, dirname, realpath. |
10. Archiving & Compression (Bash Native)​
| Module | Capability | Description |
| 10.1 | Using tar | Create and extract archives with Bash commands. |
| 10.2 | Gzip & Gunzip | Compress or decompress files efficiently. |
| 10.3 | Zip & Unzip | Archive using zip utilities from scripts. |
| 10.4 | Combine Commands | Pipe output for chained compression workflows. |
| 10.5 | File Integrity | Validate success of archiving operations via exit codes. |
11. Error Handling & Debugging​
| Module | Capability | Description |
| 11.1 | Exit Status | Check return values to detect failures. |
| 11.2 | Error Redirection | Redirect errors to files using 2> and &>. |
| 11.3 | Traps & Signals | Catch interrupts (SIGINT, SIGTERM) and execute cleanup. |
| 11.4 | Debug Options | Enable tracing with set -x, stop on error with set -e. |
| 11.5 | Safe Execution | Combine error handling in automation scripts. |
12. Process & Job Control​
| Module | Capability | Description |
| 12.1 | Foreground & Background Jobs | Run tasks in background using &, fg, bg. |
| 12.2 | Job Listing | View and manage running tasks with jobs. |
| 12.3 | PID Handling | Use $!, kill, and wait for process control. |
| 12.4 | Subshells | Execute isolated commands in a separate environment. |
| 12.5 | Daemon Scripts | Build scripts that run persistently in background. |
13. Date & Time Utilities​
| Module | Capability | Description |
| 13.1 | Date Command | Retrieve and format dates with date. |
| 13.2 | Time Arithmetic | Use date -d for relative date operations. |
| 13.3 | Sleep & Delay | Pause script execution with sleep. |
| 13.4 | Script Timing | Measure runtime with time command. |
| 13.5 | Timestamping | Append date/time to log and backup filenames. |
14. Scheduling & Automation​
| Module | Capability | Description |
| 14.1 | Cron Jobs | Schedule recurring Bash script execution. |
| 14.2 | At Command | Schedule one-time jobs. |
| 14.3 | Intervals & Loops | Create manual timing inside scripts using sleep. |
| 14.4 | Log Redirection | Record automation results with >> logfile. |
| 14.5 | Job Verification | Validate cron or script status via exit codes. |
15. Advanced Bash Concepts & Integration​
| Module | Capability | Description |
| 15.1 | Regular Expressions | Match text patterns inside [[ ]] using =~. |
| 15.2 | Command Substitution | Embed command results inside variables ($(command)). |
| 15.3 | Parallel Execution | Run multiple processes concurrently using background jobs. |
| 15.4 | Arrays & Associative Arrays | Store multiple values and access dynamically. |
| 15.5 | Script Optimization | Use functions, lazy evaluation, and modularization for performance. |