Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Perl aside, I would say that's almost imperative to learn sed and awk. They invaluable tools for getting things done in *nix. They seem cryptic at first, but put a weekend into learning them and you learn that they are simply concise.


And then you have a script that needs to run on a mac as well and you can either fight that the people will install the gnu version or you just rewrite your one-liner in perl.

I'm not a huge fan of perl but I've been writing my one-liners in it for a few years now and I've had less problems with portability.


I would use another language for distributing a script (probably) python. Awk and sed I use more on a one-off basis although I do have a list of ones I use frequently.


Would that be the deprecated 2.x with OS X or 3.x which has been available for years?

To put it another way, you've replaced sed incompatibility with python incompatibility. It's not really a win.

I'm not saying Perl is the best choice here, but it's a better choice than Python for cross platform compatibility.


And as an extremely good free resource for awk I recommend:

https://www.gnu.org/software/gawk/manual/gawk.html#Getting-S...



Thanks! It has really good coverage of all the shell-related problems.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: