BASH SCRIPTING
Loops in Bash
- For loop (list)
- For loop (range)
- C-style For loop
- While loop
- Until loop (runs until condition is true)
- Infinite loop
Arguments in Bash
- $0 → script name (how it was called).
- $1 … $9 → first nine arguments.
- ${10}, ${11}, … → arguments beyond 9.
- $# → number of arguments.
- $@ → all arguments (as separate words).
- $* → all arguments (as one string).
Script name: ./myscript.sh
First arg: data.txt
Second arg: admin
File: data.txt, User: admin
- string operators
- integer operators
- file operators
- boolean operators
String Operators
Integer Operators
File Operators
Logical Operators
Arithmetic Operators
- Branches:
- If-Else Conditions
- Case Statements
- Loops:
- For Loops
- While Loops
- Until Loops


