Linux Shell Scripting

  1. Core Scripting Fundamentals
    1. Variables and Data Types
      1. Variable Declaration and Assignment
        1. Basic Assignment Syntax
          1. No Spaces Around Equals Sign
            1. Case Sensitivity
            2. Variable Naming Conventions
              1. Allowed Characters
                1. Reserved Words to Avoid
                  1. Best Practices for Readability
                    1. Environment Variable Conventions
                    2. Variable Expansion
                      1. Basic Expansion
                        1. Brace Expansion for Clarity
                          1. Parameter Expansion Modifiers
                          2. Data Types in Shell
                            1. Strings (Default Type)
                              1. Integers
                                1. Arrays
                                  1. Environment Variables
                                  2. Variable Scope
                                    1. Global Variables
                                      1. Local Variables
                                        1. Exported Variables
                                          1. Subshell Variable Inheritance
                                          2. Quoting and Escaping
                                            1. Single Quotes (Literal Strings)
                                              1. Double Quotes (Variable Expansion)
                                                1. Backslash Escaping
                                                  1. ANSI-C Quoting
                                                  2. Command Substitution
                                                    1. Backticks (Legacy Syntax)
                                                      1. Dollar-Parentheses Syntax
                                                        1. Nested Command Substitution
                                                          1. Performance Considerations
                                                          2. Built-in Shell Variables
                                                            1. User and System Information
                                                              1. HOME
                                                                1. USER
                                                                  1. HOSTNAME
                                                                    1. SHELL
                                                                    2. Path and Directory Variables
                                                                      1. PATH
                                                                        1. PWD
                                                                          1. OLDPWD
                                                                            1. CDPATH
                                                                            2. Shell Behavior Variables
                                                                              1. PS1
                                                                                1. PS2
                                                                                  1. IFS
                                                                                    1. LANG
                                                                                  2. Positional Parameters
                                                                                    1. Script Name
                                                                                      1. Command-Line Arguments
                                                                                        1. Number of Parameters
                                                                                          1. All Parameters as Single String
                                                                                            1. All Parameters as Separate Strings
                                                                                              1. Shifting Parameters
                                                                                              2. Special Parameters
                                                                                                1. Exit Status of Last Command
                                                                                                  1. Process ID of Current Shell
                                                                                                    1. PID of Last Background Command
                                                                                                      1. Current Shell Options
                                                                                                        1. Random Number Generator
                                                                                                      2. Input and Output Operations
                                                                                                        1. Standard Streams
                                                                                                          1. Standard Input (stdin)
                                                                                                            1. Standard Output (stdout)
                                                                                                              1. Standard Error (stderr)
                                                                                                                1. File Descriptors
                                                                                                                2. Reading User Input
                                                                                                                  1. The read Command
                                                                                                                    1. Reading Multiple Variables
                                                                                                                      1. Prompting the User
                                                                                                                        1. Silent Input for Passwords
                                                                                                                          1. Timeout Options
                                                                                                                            1. Input Validation
                                                                                                                            2. Displaying Output
                                                                                                                              1. The echo Command
                                                                                                                                1. Basic Usage
                                                                                                                                  1. Escape Sequences
                                                                                                                                    1. Newline Control
                                                                                                                                      1. Portability Considerations
                                                                                                                                      2. The printf Command
                                                                                                                                        1. Format Specifiers
                                                                                                                                          1. Formatting Numbers
                                                                                                                                            1. Formatting Strings
                                                                                                                                              1. Differences from echo
                                                                                                                                            2. Input/Output Redirection
                                                                                                                                              1. Output Redirection
                                                                                                                                                1. Overwriting Files
                                                                                                                                                  1. Appending to Files
                                                                                                                                                    1. Redirecting to /dev/null
                                                                                                                                                    2. Input Redirection
                                                                                                                                                      1. Reading from Files
                                                                                                                                                        1. Input from Devices
                                                                                                                                                        2. Error Redirection
                                                                                                                                                          1. Redirecting stderr
                                                                                                                                                            1. Combining stdout and stderr
                                                                                                                                                              1. Separating Output Streams
                                                                                                                                                              2. Advanced Redirection
                                                                                                                                                                1. File Descriptor Manipulation
                                                                                                                                                                  1. Exec Command for Redirection
                                                                                                                                                                    1. Process Substitution
                                                                                                                                                                    2. Here Documents
                                                                                                                                                                      1. Multi-line Input
                                                                                                                                                                        1. Variable Expansion in Here Docs
                                                                                                                                                                          1. Quoting Delimiters
                                                                                                                                                                            1. Indented Here Documents
                                                                                                                                                                            2. Here Strings
                                                                                                                                                                              1. Single-line Input
                                                                                                                                                                                1. Use Cases and Examples
                                                                                                                                                                              2. Pipes and Filters
                                                                                                                                                                                1. Basic Pipe Usage
                                                                                                                                                                                  1. Chaining Multiple Commands
                                                                                                                                                                                    1. Named Pipes (FIFOs)
                                                                                                                                                                                      1. Tee Command for Splitting Output