Hacker News new | ask | show | jobs
by filesystemdude 2335 days ago
This.

A Python script is not the answer when I'm trying to do something quick and dirty at the shell.

The beauty of shell scripting is that it evolves seamlessly from trying to solve simple problems at my command prompt. I pipe a couple of things together, and then I realize I could use a loop and a few conditionals, and suddenly it makes sense to store this in file in case I want to do this again. Boom, program done.

It now works on every computer I own.

I love Python. I use it almost every day. But I'll be damned if I'm going to go rewrite every shell snippet I hack together into Python just because it exists.

Different problems, different solutions.

2 comments

Your observation about the seamless evolution of a basic shell script from a few lines typed interactively is very insightful.

This kind of automation adds a lot of value for low marginal effort and probably explains a lot of the short scripts I have laying around in directories.

True that. But everyone should keep in mind that script bloat is real. If you're not careful you'll end up like me, and accidentally have to maintain what is essentially npm but written entirely in bash.