Comment by kissickas

11 years ago

Why do I get:

> unknown unit 'millilightseconds'

Is this one of the embellishments that just makes the story more entertaining?

Not an embellishment at all.

Via 'man units': "The conversion information is read from a units data file that is called 'definitions.units' and is usually located in the '/usr/share/units' directory."

Via definitions.units (L. 223), you can see the milli- prefix: https://gist.github.com/anonymous/f06769de95e0c7f9e658#file-...

Via deifnitions.units (L. 1060), you can see the lightsecond unit: https://gist.github.com/anonymous/f06769de95e0c7f9e658#file-...

Maybe check it for completeness?

Edit: Spelling

  • Some distributions only support lightyear so adding this line to your units file (which you can find with man units) will give you support for *lightseconds:

    lightsecond lightyear / 365.25 / 24 / 60 / 60

I had the same thing happen to me. From the manpage I gathered that units uses the definitions defined in /usr/share/misc/units.lib, by running cat /usr/share/misc/units.lib | grep light I found I only had lightyear and it's shortcut ly defined. I added lightsecond, and since milli prefix is already defined it worked a treat.

Here's the line you'll want to add:

lightsecond lightyear / 365.25 / 24 / 60 / 60

If you're on a mac, try $ brew install gnu-units - it's probably using a very incomplete library of units.

More complete units library. Note how the original author's units has 1311 units and 63 prefixes, OSX only has 586 and 56.