A hands-on repository documenting my journey of learning Bash Shell Scripting for DevOps.
This repository contains practical shell scripts, exercises, log-processing examples, and automation practice designed to build the scripting skills commonly used in DevOps, Cloud, Linux, and Infrastructure Automation.
Shell scripting is an important skill for DevOps engineers because it allows repetitive operational tasks to be automated.
Through this repository, I am practising how to use Bash to:
- Automate repetitive Linux tasks
- Work with variables and user input
- Use conditional statements
- Work with loops
- Create reusable functions
- Process files and logs
- Handle errors
- Execute Linux commands through scripts
- Build automation useful for DevOps workflows
Shell-Scripting-For-DevOps/
│
├── day01/
├── day02/
├── day03/
├── log-files/
├── practice-scripts/
│
├── hello.sh
├── variables.sh
└── README.md
Introduction to shell scripting and Bash fundamentals.
Topics include:
- Basic Bash syntax
- Running shell scripts
- Variables
- Printing output
- Command execution
Continues into programming concepts used in Bash.
Topics include:
- Conditional statements
- Loops
- User input
- Arguments
- Basic automation logic
More practical shell scripting and DevOps-focused exercises.
Focus areas include:
- Automation
- Error handling
- Linux administration
- Working with commands and services
- Practical scripting scenarios
A collection of scripts created while practising Bash concepts.
The goal of this directory is to move from basic syntax toward scripts that can automate real operational tasks.
Sample log files used to practise Linux text-processing and troubleshooting commands such as:
grep
awk
sed
cut
sort
uniq
head
tailLog analysis is particularly useful in DevOps when troubleshooting applications, servers, containers, and CI/CD systems.
- Bash
- Linux
- Shell Scripting
- Git
- GitHub
- Linux CLI
- AWS CLI
- Docker
- Cron
- grep / awk / sed
name="Riyan"
location="London"
echo "My name is $name"
echo "Location: $location"read -p "Enter your name: " name
echo "Hello $name"if [ "$1" == "start" ]; then
echo "Starting service..."
else
echo "Unknown command"
fifor server in server1 server2 server3
do
echo "Checking $server"
donecheck_service() {
echo "Checking service status..."
}current_date=$(date)
echo "Current date: $current_date"Clone the repository:
git clone https://github.com/riyan-ahmed/Shell-Scripting-For-DevOps.gitMove into the project:
cd Shell-Scripting-For-DevOpsGive a script execution permission:
chmod +x script.shRun it:
./script.shAlternatively:
bash script.shBash scripts can be debugged using:
bash -x script.shYou can also check the exit status of the previous command:
echo $?A return value of:
0
normally indicates that the command completed successfully.
Shell scripting can be used to automate tasks such as:
- Server configuration
- Application deployment
- Log analysis
- System monitoring
- User management
- Package installation
- Backup automation
- Docker operations
- Cloud resource management
- CI/CD pipeline tasks
- Scheduled jobs using Cron
Instead of manually repeating commands, DevOps engineers can turn them into reusable scripts.
The aim of this repository is to develop strong Bash scripting fundamentals and progress toward writing reliable automation for real DevOps environments.
The learning path is:
Bash Fundamentals
↓
Variables & Input
↓
Conditions
↓
Loops
↓
Functions
↓
Files & Logs
↓
Error Handling
↓
Linux Automation
↓
DevOps Automation
As I continue learning, I plan to add scripts covering:
- System health monitoring
- Disk and memory monitoring
- Automated backups
- User management
- Package installation
- Service monitoring
- Docker automation
- AWS automation using AWS CLI
- Log monitoring and alerting
- Cron job automation
- Deployment automation
Riyan Ahmed
DevOps | Cloud | Platform Engineering
GitHub: riyan-ahmed
This repository is part of my hands-on DevOps learning journey.
Rather than only studying shell scripting concepts theoretically, the focus is on writing, testing, debugging, and improving scripts through practical exercises.
If you find the repository useful, feel free to ⭐ the project.