5 ms·
> Yes, awk and sed were replaced by Perl, I still use awk and sed semi regularly. I haven’t used Perl in over a decade.
by imron 3y ago
> Yes, awk and sed were replaced by Perl,
I still use awk and sed semi regularly. I haven’t used Perl in over a decade.
- idlewords 3y agoSounds like you were also replaced by Perl.
- natch 3y ago…that you’re aware of.
- eigenvalue 3y agoAgreed. I would turn to Python for anything more involved that couldn’t be done very directly and efficiently using awk/sed. I would never use Perl for anything.
- kdmccormick 3y agoSame, but if there were no Python/Ruby/etc, I would probably be reaching for Perl quite a lot.
- kristopolous 3y ago1980s awk and sed aren't the same as the 2020s version. They've become much more useful because of the influence of things like perl. To see what I mean, here's SunOS 4.1.1's man page for awk and sed as grabbed from https://github.com/ambiamber/Run-Sun3-SunOS-4.1.1/blob/main/sunos411/sun3_manual.tar.Z https://github.com/ambiamber/Run-Sun3-SunOS-4.1.1/blob/main/... and ran through groffer(1) . These are from 1989 and 1987 respectively. The core stuff is there but not much else. https://9ol.es/sed.1v.pdf https://9ol.es/sed.1v.pdf https://9ol.es/awk.1.pdf https://9ol.es/awk.1.pdf
- tannhaeuser 3y agoAwk today is very much the same language it was in 1977 when it was introduced. Comparing your links with today's POSIX awk manpage doesn't yield a single thing Perl brought to awk. At best, while JavaScript syntax is even based on awk, you could say JavaScript regexpes are based on PCRE, and it wasn't clear whether use of capture groups/back references makes Perl regexpes accidentally Turing.
- kristopolous 3y agoPOSIX, right. POSIX sucks. POSIX anything is stuck 30 years ago. Nobody in 2023 really uses POSIX awk on some commercial UNIX like IBM AIX, they use GNU awk, that's the modern one I'm talking about https://www.gnu.org/software/gawk/manual/html_node/index.html https://www.gnu.org/software/gawk/manual/html_node/index.htm...
- tannhaeuser 3y agoWhat are you talking about? There is no POSIX awk implementation, just a language spec and nawk AKA the one true awk. As shipped on Mac OS, whereas Debian ships mawk in addition to gawk. gawk is just much slower and unfortunately also buggy (crashes on a non-"C" locale with complex regexpes).
- kristopolous 3y agoRight, "the one true awk" corresponds to a book written in 1988, very explicity. https://github.com/onetrueawk/awk https://github.com/onetrueawk/awk I was incorrect about 30 years. It's actually 35. You were the one that that said POSIX awk to begin with, I was using your terms. I understand what you meant, why don't you? As far as shitting on the GMU tools, I don't think I've seen someone do that in decades, especially just referencing the bottom of the man page like that. As far as speed, I don't know how you're using these tools, but if gawk is your bottleneck and not i/o, there's probably smarter ways to do things. This is not a productive conversation. You can live life however you want and if you're happy than I'm happy. We are definitely at an impasse. I'm off to bed.
- kdmccormick 3y agoWell, I look at the POSIX standards whenever I want to write shell scripts and Makefiles that work on both Linux and macOS. Which, in my current role, is often enough that I am driven crazy by how far POSIX is behind GNU tooling...
- kristopolous 3y ago
- tharne 3y ago> I still use awk and sed semi regularly. I haven’t used Perl in over a decade. Same. Awk and Sed are delightful little tools that have aged exceptionally well.
- grumpyprole 3y agoThey are also constrained languages which gives many advantages. POSIX regex will always execute in O(n), Perl "regex" are potentially exponential and can be a security risk in certain situations.
- 2colours 3y agoWell, that's at least an actual argument, even though POSIX regex would have never proven so useful in a variety of use cases. Other than that, I'm completely shocked that somebody would praise sed or awk in well into the 21st century. Turing-complete languages barely capable of properly solving any problem that has any sort of algorithmic complexity, let alone one that requires proper data types, variables or interacting with any sort of system. Really, you can do that in Perl (even in Raku) without your couple-of-liner horribly breaking down once you need some custom logic to it. Oh, and it will even resemble programming languages, not some hieroglyphs left behind by aliens.
- 2colours 3y agoWhat is the reason for that? I think they should be long gone for the lack of proper data structures, if nothing else.