I was always afraid of writing shell scripts. Bash seemed to be a programming language that doesn’t allow a slightest mistake… Extra space here and there and everything blows up.
Like with every skill, persistence and repetition help. I’ve started writing more and more bash scripts a few years ago. But it’s important to remember one simple rule – when things become really complex you need to switch to Python/Ruby/scripting language of your choice. Please do!
Anyway, today I want to share some of the very practical conventions, best practices and recommendations I gathered over these years.
It’s not an introduction to bash, you should have some background already (ideally some war stories as well).
Also, I’m not an expert! It’s ok to not agree with me. And I’m pretty sure almost everything I mention can be improved. So please help me and leave some feedback ;–)