the f*ck rants about stuff

No more bash

bash logo crossed

I recently stopped my (imho bad) habit of starting shell scripts in bash; no matter how small the task at hand feels originally

I had an epiphany

The number of bash scripts that grew out of control was just too damn high

ive been told that

it's a difficult balance

But is it really?

Its always the same story

  1. Well, I only have to run the same handful of commands multiple times in different directories, a shell script will do
  2. Except, sometimes it fails when…/this special case if../oh, never considered this… I will just add a couple more lines and fix it
  3. Script explodes, and gets rewritten in python

It rarely had exceptions for me. Almost every .sh (if its intended to automate something) had to do sanity checks, error control/recovery and probably special case scenarios… eventually

Im aware that if you are well versed in bash, you can do a lot. It has arrays and all kind of (imho weird) string mangling to make advanced use of variables, but it always felt like bash was filled with pitfalls that you have to learn to route around

Writting the same thing in python takes about the same time. Maybe a couple more lines to write a few imports

Im aware that python comes with its own pitfalls, but at least you can actually scale it when needed. And you save the rewritting part

This is really hard for me to say

I grew to love long one liners of pipes that solve complex problems. Also, most of the time you only seem to want to run a couple of commands on tandem

But I think its time for me to say goodbye. In the same way I said goodbye to perl (and thats a rant for another day :))

No more shell scripts

No matter how small


If you liked this, I think you might be interested in some of these related articles:

¡ En Español !