3 ms·
How often do you think utilities like sed, awk, and grep are being updated? They're virtually unchanged for 20-30 years.
by bink 5y ago
How often do you think utilities like sed, awk, and grep are being updated? They're virtually unchanged for 20-30 years.
- touisteur 5y agoI'll bite and talk about centos, the 'stable' distro. Take the example of 'tar' that slowly evolved and some time even changed its default behaviour. e.g. what to do when untaring a folder but there's already a symlink with the same name as the folder, do you erase the symlink and create a folder or do you untar the folder in the symlink? Between centos 5 and 7 this changed... Causing me some amount of pain. hostname stopped supporting '_' in host names. Could have raised a warning, have added a '-pedantic' option but no. hostname stopped assigning the permanent host name with the 'hostname myhostname' command and now you need to use hostnamectl. Could have left the 'old' feature and make hostnamectl whine instead, but no. ifconfig the deprecated tool subtly changed the order of fields too and now the MAC address is not in the same place as before, breaking scripts that trusted that not to change. df changed its syntax, adding or removing a new-line some time ago. Yeah thinking back we shouldn't have used the standard tools and expected them not to change. So, now, whenever I see in code review some bash person using 'standard' tools to get info that could be gathered through procfs or sysfs, I instead ask they use procfs, sysfs or ioctls and be done with it.
- fouric 5y agoHmmm, maybe "everything is text" wasn't such a good idea after all...
- colejohnson66 5y agoPowershell might be what you're looking for. Text is thrown away in favor of .NET objects (and reflection)
- fouric 5y agoYes, I'm a fan of PowerShell! (I just wish it was a Linux thing and not a Windows one...)
- jabbany 5y agoTo be fair, the last two are more from a bad design choice by *nix in general to base everything on passing around unstructured text and hoping each tool's ad-hoc schema won't change.
- touisteur 5y agoThat 'hope' was true for some time, I guess. Those systems had no problems with previous migrations from early fedoras to centos 5.9... When your last line of compatibility is procfs and sysfs and ioctls or posix calls (statvfs for free disk space), well I know what Linux devs think of their installed userbase's time. Yeah yeah free stuff for free alright. Still, if you'd paid for rhel, same shit. Thank your dogs we provide an /etc/redhat-release, heh.
- touisteur 5y agoAnd if course even Linux procfs is not without its surprises. Adding columns or lines was foreseen but some changes are more fun! Take the evolution in /proc/meminfo that changed the meaning of some of the lines there over time (WTF?), whilst adding others (which was fine, expected, etc.). Of course I want now to include IO cache (that will be reclaimed if I ever needed to malloc) in my system's free memory indicator! Heh you can still get back the old value with this formula, what are whining about?
- fnord123 5y agoGnu grep uses Boyers-Moore for searching - it's wicked fast. BSD grep installed by default on Macos might not be using this algorithm. This 2 year old HN post shows the performance difference between Gnu grep and BSD grep on Macos: https://news.ycombinator.com/item?id=19522456 https://news.ycombinator.com/item?id=19522456
- sva_ 5y ago> How often do you think utilities like sed, awk, and grep are being updated? sed 4.8 - 15 Jan 2021 awk 5.1.1 - 28 Oct 2021 grep 3.7 - 14 Aug 2021 What am I missing here?