Skip to main content

Posts

Featured

Blog 14 From Basics to Pro: Functions, Logs & Loops in Shell Scripting

Functions, Colors, Logs & Loops in Shell Scripting Functions, Colors, Logs & Loops in Shell Scripting Welcome back to our shell scripting series 🚀 In the last blog, we covered variables, conditions, and datatypes. Today, let’s step into some powerful concepts: Functions, Colors, Logs, and Loops . These are the real game-changers when building scripts for automation. 1️⃣ Functions – Reuse Your Code A function is like a shortcut. Instead of repeating the same lines, wrap them in a function and call it anytime. FUNC_NAME() { # code here } FUNC_NAME # calling function 2️⃣ Passing Arguments You can pass inputs to your function. Inside the function, $1 means the first argument, $2 the second, and so on. FUNC_NAME input1 input2 FUNC_NAME() { echo "First arg: $1" echo "Second arg: $2" } 3️⃣ Why Use Functions? Follow DRY → Don’t Repeat Yourself Keep scripts clean & s...

Latest Posts

Blog 13 Boring to Pro: Making Shell Scripts Smarter with Functions, Colors & Logs”

Blog 12 Git & Shell Scripting Made Easy: Learn Version Control and Automation

Blog 11 DevOps & Backend Starter Guide From Linux Commands to CI/CD Automation

Proxy vs Reverse Proxy

Blog 10 Understanding DNS to Inodes: From Browsers to Backends

Blog 9 Getting Started with DevOps: What Every Beginner Should Know

blog 8 How to Run Your App Like a Background Service (Even After Reboot!)

blog 7 Understanding 3-Tier Architecture with Real-Life Examples

Blog 6: Linux Permissions, SSH & Service Management – DevSecOps Foundations

Blog 5: Learn VIM Editor & Linux User Commands (Simple & Powerful)