Useful Links
Computer Science
Programming
By Language
Bash/Shell Scripting
1. Introduction to the Shell and Scripting
2. Core Scripting Concepts
3. Control Flow and Logic
4. Working with Data
5. Functions and Modularity
6. Advanced Scripting Techniques
7. Debugging and Best Practices
Control Flow and Logic
Conditional Statements
The if Statement
Basic Syntax
Single Command if
Multi-line if Blocks
if-else Statements
Basic else Clause
Nested if-else
if-elif-else Statements
Multiple Conditions
Complex Decision Trees
Test Commands
test Command
Square Brackets ([ ])
Double Square Brackets ([[ ]])
String Comparisons
String Equality (=, ==)
String Inequality (!=)
String Length (-z, -n)
Lexicographic Comparison (<, >)
Pattern Matching (=~)
Numeric Comparisons
Equal (-eq)
Not Equal (-ne)
Less Than (-lt)
Less Than or Equal (-le)
Greater Than (-gt)
Greater Than or Equal (-ge)
File and Directory Tests
File Existence (-e)
Regular File (-f)
Directory (-d)
Readable (-r)
Writable (-w)
Executable (-x)
File Size (-s)
Symbolic Link (-L)
File Age Comparisons (-nt, -ot)
Logical Operators
AND (&&)
OR (||)
NOT (!)
Grouping with Parentheses
The case Statement
Basic Syntax
Pattern Matching
Literal Patterns
Wildcard Patterns
Character Classes
Multiple Patterns
Fall-through Behavior
Default Case (*)
Complex Pattern Examples
Loops
The for Loop
List-based for Loops
Range-based for Loops
C-style for Loops
Iterating over Arrays
Iterating over Command Output
Iterating over Files
The while Loop
Basic Syntax
Condition Testing
Reading Files Line by Line
Infinite Loops
Counter-based Loops
The until Loop
Basic Syntax
Condition Testing
Use Cases
Loop Control
break Statement
continue Statement
Nested Loop Control
The select Loop
Creating Menus
User Input Handling
Customizing Prompts
Breaking from select
Previous
2. Core Scripting Concepts
Go to top
Next
4. Working with Data