Need a ‘unit converter’ ?

Answer: Try units. This is an example of a terminal session using units:


$ units
2084 units, 71 prefixes, 32 nonlinear units
You have: 2 inch
You want: mm
* 50.8
/ 0.019685039
You have:

Type help for some help, press ^D to quit units.
Example of usage in a shell script:


# determine installed RAM
kbram=`cat /proc/meminfo | awk '/MemTotal/ { print $2 }'`
gbram=`units "${kbram} kilobytes" 'gigabytes' |sed --silent -e '1p' | awk '{print $2}'`
echo This computer has $gbram Gb of RAM installed!

More info: www.gnu.org/software/units/manual/units.html

Related nerd note: Eenheden toevoegen aan de ‘Unit Converter’ widget.

One Response to “Need a ‘unit converter’ ?”

  1. Ulises says:

    Their projects seems to be very interesting,lucy

Leave a Reply