Hacker News new | ask | show | jobs
by 77pt77 1073 days ago
> simplicity of GNU utils and the expressivity of a scripting language, but doesn't do either of those things better than the equivalent sed/Python etc.

It does scripting and gluing scripts far better than python.

It's not even close.

I'm not even going to address sed, awk, bash and the like.

2 comments

Just imagine writing bash incorporating a sed script for something you can do with 20 keystrokes, then migrating the sed part to awk until it reaches 20 lines, then rewrite the whole thing to Python or somehow bridge it to the shell script - when you could have done the whole thing in Perl without feeling that it holds you back...
> without feeling that it holds you back

This. I always feel like bash and pipes are always holding me back and resisting.

Python is just to verbose to exec/pipe/read/write.

The real issue is the it's really easy to shoot yourself in the foot with perl.

if you have a script that makes heavy use of sed, awk, tr and the like, then maybe translating to perl would be most natural.

but otherwise a script is either just calling a lot of commands one after the other, for which a shell script is fine. or they do a lot of data mangling without needing many external applications or none even, in which case any other languages besides perl is just as fine.