Bash is a good automation tool

Bash gets a lot of hate but for all the wrong reasons. Mainly you'll hear that it's "not a real programming language", that bash scripts lack idempotence, that they aren't maintainable, and so on... all of these are valid points, but they are built on the assumption that bash scripts are used for the wrong purpose.

Yes, maybe in your enterprise setting, using bash scripts to deploy stuff to production is a bad idea. But for building small targeted automation tools, bash is perfect. Maybe it's not elegant, but it's simple, gets the job done, and is available on every Unix-like system.

The language

Bash is a shell scripting language, which means it's designed to interact with the system. It's not a general-purpose language, and it's not designed to be one. It's designed to be a glue language. That is what makes it useful. It's not a language that you'll use to build a web application, but it's a language that you'll use to automate your daily tasks.

I'm pretty sure that you run dozens of shell commands every day (if you're a developer), and I'm pretty sure that you have "chains" of commands that you run daily in sequence. Let's say that each morning you pull the latest changes from your git repository, install dependencies, run migrations, and start your development server. You can create a bash script that does all of this for you, and you can run it with a single command. Why not do it? It saves time, makes your process repeatable, and makes sure you don't forget any steps.

Idempotence

You know how to write if statements, right? You know how to check if a file exists, right? You know how to check if a process is running, right? Then you know how to write idempotent bash scripts. Idempotence is not some magical ability granted to Ansible or Terraform, it's a concept that you can apply to any script.

Maintainability

If some task feels too complex for bash, don't use it. If you only write scripts that are so simple that they can be understood at a glance, you'll never have to worry about maintainability. If you need to write a complex script, maybe you should consider using a different tool (like Python, Ansible, or something).

When to stop

Are there any specific guidelines for when to ditch bash and use something else? I would say that when you start spending unreasonable amounts of time debugging. Writing bash scripts shouldn't feel like "software engineering", it should feel like "gluing stuff together". If it feels like the former, go build your thing with Rust or something.

Conclusion

Go try bash scripting. Automating your daily development chores is a great way to start.