Bash Scripting for DevOps with Environment Variables

Bash Scripting for DevOps — Part 10/? Till now, my scripts worked. But everything inside them was hardcoded. So every time I wanted to run it for a different environment, I had to go and change the script. That didn’t feel right. In real DevOps workflows, we don’t change the script. We change the environment. For example: ENV=staging ./deploy.sh Inside the script: echo "Deploying to $ENV environment" Now the same script works for dev, staging, and prod without changing the code. Just by changing the input. Small change in approach, but this is what makes scripts flexible and reusable. And this is used everywhere — CI/CD, Docker, Kubernetes. #DevOps #BashScripting #Linux #Automation #DevOpsJourney #LearningInPublic

  • diagram

To view or add a comment, sign in

Explore content categories