basic scripts
✅ Shell Basics
echo $SHELL # Check the default shell for the user (e.g., /bin/bash, /bin/zsh)✅ Shebang
#!/bin/bash # Shebang line to specify the script should run using the bash shell✅ Script: exp1.sh
exp1.sh#!/bin/bash
# Script to print static welcome message
echo -e "Hi\nThis is DevOps class"
echo "Started on Nov"🔧 Execution Methods
./exp1.sh # Executes script directly (make sure it's executable)
bash exp1.sh # Executes using bash explicitly
sh exp1.sh # Executes using default shell interpreter✅ Script: exp2.sh
exp2.sh🔧 Execution Example
✅ Input Arguments in Shell Script
🧠 Example:
✅ Script: exp3.sh
exp3.sh✅ Conditional Statement Syntax
✅ Script: exp4.sh – Check if Number is 5
exp4.sh – Check if Number is 5✅ Numeric Comparison Operators in Bash
Operator
Meaning
✅ Script: exp5.sh – Biggest of Two Numbers
exp5.sh – Biggest of Two Numbers✅ Script: exp6.sh – Biggest of Two Numbers with Argument Check
exp6.sh – Biggest of Two Numbers with Argument Check✅ Special Shell Variables
Variable
Meaning
✅ Loop Syntax
🔁 for Loop
for Loop🔁 while Loop
while Loop✅ Script: Check File, Directory, Link, or Not Exist
✅ Script : Disk Usage Alert if More Than 90%
✅ Cron Job Syntax Reference
Field
Range
Description
✅ Useful Cron Commands
✅ Cron Job Examples
✅ Display Employees Over Age 40
📄 input File: employees.txt
employees.txt✅ Script: filter_employees.sh
filter_employees.sh