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

>GNU and BSD variants behave very differently making for a lot of bugs on scripts that need to work on both Linux and MacOS

Perl shines for this use case (assuming it is present in the machines you are working with). It is slower than grep/sed/awk for most cases, but it is more powerful and better portable across platforms.

>converting YAML to JSON on the command line

check out https://github.com/bronze1man/yaml2json



> Perl shines for this use case (assuming it is present in the machines you are working with). It is slower than grep/sed/awk for most cases, but it is more powerful and better portable across platforms.

Agreed.

For better or worse, when performance is not a concern in my scripts, I just shell out to "perl -pe" rather than trying to deal with grep, sed or awk.

It just works.




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

Search: