3 ms·
My first paid job programming was as a high schooler, a summer job for a university professor, circa 1992, using awk to analyze log file from a NeXTStep desktop
by jrochkind1 6y ago
My first paid job programming was as a high schooler, a summer job for a university professor, circa 1992, using awk to analyze log file from a NeXTStep desktop app (for some kind of scientific computing, I forget), for a usability study.
Even during that job, as the complexity of the analysis increased, my supervisor/mentor suggested "Have you heard of Perl? You might find that more convenient." And I did find it more convenient, it was clear it could do everything awk provided as well as awk (even using close to the same syntax if you wanted), plus more.
Which led to my first web job, as a university student circa 1996, writing 'dynamically generated web pages' with Perl cgi, for the university. (At this point I haven't written Perl either in at least 15 years, and don't tend to miss it).
The main reason to use awk as opposed to a more convenient language (other than "our legacy code is written in it and it would be a big investment to port it" -- a couple cases in OP) seems to be that it's present on nearly every system. But isn't also Perl?
- PopeDotNinja 6y agoI believe Perl is not part of POSIX. So while you'll see it most places, you won't see it everywhere. For example, you'd bump into strict POSIX compliance in containers that are kept as small as possible. You probably won't find Perl on a Busybox container installed by default, but I believe that container would still contain awk. I can't verify this myself at the moment.
- jrochkind1 6y agoThanks, that makes sense. That the functioning of awk was part of POXIS was something I just learned from this article, and which surprised me. That POXIS includes specifications of entire languages within it! I guess it makes sense, but wow. But I guess the extensions and advancements to awk being discussed in OP would not be part of POSIX-awk, so not necessarily to be found on a POXIS system, true? Would people using awk for it's POSIX-reliability avoid using new fangled awk innovations?
- aNoob7000 6y agoI feel the same way about VI. In college, a professor forced us to learn it. I still remember him saying, "VI is on all Unix systems. If you learn it, you will always be able to edit a file."