←back to thread

212 points todsacerdoti | 1 comments | | HN request time: 0.206s | source
Show context
jph00 ◴[] No.46006734[source]
There’s already a language that provides all the features of awk plus modern language conveniences, and is available on every system you can think of. It’s Perl.

It even comes with an auto translator for converting awk to Perl: https://perldoc.perl.org/5.8.4/a2p

It also provides all the features of sed.

The command line flags to learn about to get all these features are: -p -i -n -l -a -e

replies(2): >>46006936 #>>46011256 #
1. AdieuToLogic ◴[] No.46011256[source]
> The command line flags to learn about to get all these features are: -p -i -n -l -a -e

One of my favorite Perl mnemonics when needing to apply edits to a set of files is:

  With Perl, it is as easy as pie.
Which reminds me that making a global substitution across N files can be done with:

  perl -p -i -e '<insert substitution here>' $WHAT_FILES