4 ms·
Thanks for this. I'd probably call the original the GNU coreutils version. The linked github also has a sed-only version in the comments. It's instructive to se
by version_five 4y ago
Thanks for this. I'd probably call the original the GNU coreutils version. The linked github also has a sed-only version in the comments. It's instructive to see the different versions.
- js2 4y agoI just added a sed version as well. I'll have to click through and see how closely it resembles what's in the gist. bash is actually pretty powerful if you don't mind its baroque syntax. Writing it in POSIX would be a bit more challenging. You could use a case statement for the pattern matching, but I'm not sure about the substitution.
- kps 4y ago> I'd probably call the original the GNU coreutils version. Why? The only GNUish bit is the grep -P option, which is unnecessary (-E will do as well).
- version_five 4y agoI would have considered tr to be part of gnu coreutils, awk, not necessarily but the default on a mac is gawk I believe
- kragen 4y agotr predates GNU by about a decade.