Days 6–8: Shell Scripting — Practiced, Scripted, Pushed


So here we are, wrapping up Days 6 7 and 8 of my 40 Days of DevOps Reset — and this one was all about Shell Scripting.
I thought it would be more of a refresher, but turns out it was a solid learning zone. I didn’t just practice commands — I wrote actual scripts, tested them, and ended up with a proper GitHub repo full of Bash files. Feels good.
🎥 What I Watched
To kick things off, I followed this YouTube video:
"Shell Scripting in 1 Shot" by TrainWithShubham
It covers everything from variables to loops, conditionals, and even real use cases like log cleanup and automation.
The format was great — short segments, easy examples, and clean explanations. I watched a section, paused, tried it out in my terminal, then repeated the process. No binge-watching, just hands-on learning.
🛠️ What I Practiced
Here’s the breakdown of what I wrote and worked on over the two days.
✅ 01–03: The Basics
01_hello.sh
: My first classic “Hello World” in Bash02_variables.sh
: Declaring, modifying, printing variables03_input_output.sh
: Usingread
,echo
, piping data around
🔁 04–06: Logic and Control
04_arguments.sh
: Playing with$1
,$2
,$#
, and checking args05_if_else.sh
: Conditional logic, nestedif
,elif
,else
06_loops.sh
:while
,for
,until
— looping over lists and conditions
🔧 07–09: More Real Use
07_functions.sh
: Reusable logic with parameters08_error_handling.sh
: Exit codes,trap
, and safety09_deploy_django_app.sh
: Script to clone and start a Django app
📁 10–13: File Utilities
10_logrotation_cleanup.sh
: Deleting logs older than X days11_count_no_of_files.sh
: Count files in a directory12_greeting.sh
: Auto greet based on time of day13_file_extension_check.sh
: If-else script based on file extension
🧮 14–15: Utilities & Math
14_simple_calculator.sh
: Calculator usingexpr
andread
15_directory_creator.sh
: Script to create directories based on input
🛠️ 16–18: Useful Scripts
16_file_backup.sh
: Copy files to a backup folder with timestamp17_log_file_analyzer.sh
: Reads logs and filters error patterns18_disk_monitor.sh
: Disk space monitoring and alert if low
💡 What Helped Me Learn
I didn’t skip practicing — everything was hands-on
Used
nano
andVS Code
together for writing and testingDebugged using
bash -x
, usedchmod +x
to make scripts executableTried to run each script with valid and invalid inputs to test cases
Built simple functions inside loops to reuse logic
I kept it very real — no perfect code, just working and readable
😅 What Was Tricky
Forgetting to quote variables caused weird bugs
Confused between
[
and[[
at firstUsing
expr
vs arithmetic expansion$(( ))
Debugging missing
fi
ordone
— classic Bash errorsRemembering file permissions when scripts wouldn’t run
💻 Repo Is Live!
You can check all my scripts here:
👉 Shell Scripting Practice GitHub Repo
It’s public, structured, and fully commented in most places. I’ll probably keep improving it as I revisit during later phases.
🧠 Takeaway from Day 6-8
Shell scripting might look “easy” from the outside, but writing clean, functional scripts takes practice. These two days were pure practice mode — and now I can confidently say I can script out small utilities or automations when needed.
It’s like giving your Linux terminal superpowers.
Next up: Git, Gitlab and Containerization .
Let’s see how that goes in Day 9 and 10. 👀
Back to YAML, images, volumes… you know the drill.
Stay tuned. 🚀
— Areeba Hassan
Subscribe to my newsletter
Read articles from Areeba Hassan directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Areeba Hassan
Areeba Hassan
I’m Areeba Hassan, a driven Software Engineering student a at VU, with a passion for DevOps and cloud-native technologies. I’m fascinated by automating workflows and building scalable systems that power modern applications. With a solid foundation in tools like Docker, Kubernetes, Terraform, and Jenkins, I thrive on tackling complex challenges and exploring innovative solutions. My coursework in Data Structures, Operating Systems, and Software Engineering fuels my curiosity and technical growth. I’m excited to share my learning journey on LinkedIn and GitHub, connect with the tech community, and grow as a DevOps engineer. Let’s collaborate and innovate! 🚀