The appeal of GNU tools

April 16, 2008

I admit that every so often the freakish superintelligence of the GNU versions of programs has its appeal. Consider, say, units:

You have: 7 feet + 2.5 inch
You want: mm
        * 2197.1
        / 0.00045514542

GNU date is another good one:

; date -d 'last sunday'
Sun Apr 13 00:00:00 EDT 2008

Or even better:

; date -d 'last saturday -1 week'
Sat Apr  5 00:00:00 EDT 2008

(Judging from the manpage, BSD date may also have some freaky superintelligent date math stuff, and judging from some experimentation, GNU date is not all that superintelligent, or at least not that well documented, since I couldn't see an obvious way to do something like 'the third Saturday in January 2008'. As an aside, the GNU date documentation perfectly illustrates the downfall of the GNU's (text)info documentation format.)

Also, I will admit that sometimes GNU is plain right about things. For instance, I'm pretty convinced that the -h option to df, du, and ls just is easier for people to read; I find myself usually using it unless I am going to feed the output to something else.


Comments on this page:

By nothings at 2008-04-17 03:33:39:

What in the world is that units output saying? "Here is the way you convert from units of 7-feet-2.5-inches to units of millimeters", I guess?

Of course, try http://www.google.com/search?hl=en&q=7+feet+2.5+inches+in+mm

As an aside, the GNU date documentation perfectly illustrates the downfall of the GNU's (text)info documentation format.

How so? I hate info so much I'd like to hear about its downfall... is it better documented elsewhere, or do you just mean they haven't done a good job of updating it and you think its info-ness is relevant?

By cks at 2008-04-17 08:10:42:

Wow, Google is freakishly superintelligent too. I guess I should have figured that out by now.

I'm not sure what units thinks it is doing, but the net effect is that you can convert between some quantity of a unit and another unit, so if you want to know what 7 miles per hour is in furlongs per fortnight it is easy to work out. (It seems that units has always done this, or at least both FreeBSD and Solaris 8 units accept the general usage.)

On GNU info, I mean that it is a terrible way of presenting documentation for things on a Unix system. (Explaining why is long enough to call for another entry.)

By Dan.Astoorian at 2008-04-17 10:15:51:

GNU date's arithmetic would be more attractive to me if it didn't do stuff like this:

% date -d 'april 15 11:00am -1 day'
Mon Apr 14 11:00:00 EDT 2008

so far, so good; but:

% date -d 'april 15 11:00 -1 day'
Wed Apr 16 11:00:00 EDT 2008
% date -d 'april 15 11:00 -1 minute'
Tue Apr 15 07:02:00 EDT 2008

I get the same results from coreutils 5.2.1, 5.93, and 6.9, for what it's worth.

--Dan

Written on 16 April 2008.
« Management interfaces as isolated interfaces
My secret mouse fear »

Page tools: View Source, View Normal, Add Comment.
Search:
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Wed Apr 16 23:07:30 2008
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.