2 ms·
I still use a little sed once in a while, but Perl has replaced most of the tools like awk for me.
by tmaly 9y ago
I still use a little sed once in a while, but Perl has replaced most of the tools like awk for me.
- jstimpfle 9y agoThe advantage of awk is that it is faster in some cases and a little more convenient for simple command-lines due to automatic field splitting. The disadvantage is that it swallows errors silently even more than perl (I think).
- Annatar 9y agoI'd say that AWK's single weakness is a lack of built-in debugger or even `set -x` tracing mode like the shell has.
- tmaly 9y agoyes I agree, I have seen awk perform faster in some cases, but for the general case, I prefer something a little more flexible like Perl
- augustk 9y agoAwk is also a part of POSIX.
- mathiasrw 9y agoIf you have access to npm in your environment then try rexreplace next time.
- waynecochran 9y agoYep Perl* is a great swiss army knife that rendered sed and awk obsolete -- I am old enough (50) to have been thru this progression. It's funny to see awk and sed come back around. (It's a little like functional programming being rediscovered when Lisp has been around since the dawn of time). * I think Perl got carried away when it added objects and folks started writing large programs with it (although I have written some large scripts for biologists doing genetic studies -- which is interesting popular use case == there are google groups and O'Reilly books focused on this use case). Also, Larry Wall really humped the shark with Perl 6.