#1065593 units: Allow access to user's own input

Package:
units
Source:
units
Description:
converts between different systems of units
Submitter:
Dan Jacobson
Date:
2024-03-07 07:33:06 UTC
Severity:
normal
#1065593#3
Date:
2024-03-07 07:24:25 UTC
From:
To:
It seems that a big lack of the units program, is access to the user's
own input after he inputs it.

Often one needs access to the original input value, and currently must
use workarounds.

$ for i in `seq 5`; do echo -n "$i mi = "; units --terse ${i}mi km; done|sed 's/$/ km/'
1 mi = 1.609344 km
2 mi = 3.218688 km
3 mi = 4.828032 km
4 mi = 6.437376 km
5 mi = 8.04672 km

Maybe allow something like

$ for i in `seq 5`; do units --printf "%d{input} mi = %f{output} km\n" ${i}mi km; done

I don't know.