13 .Op Ar from-unit to-unit
15 The following options are available:
16 .Bl -tag -width indent
17 .It Fl h \&No , Fl -help
18 Show an overview of options
19 .It Fl f Ar filename \&No , Fl -file Ar filename
20 Specify the name of the units data file to load.
21 .It Fl H Ar filename \&No , Fl -history Ar filename
22 Ignored, for compatibility with GNU units.
23 .It Fl e , Fl -exponential
24 Behave as if -o '%6e' was typed.
25 .It Fl q \&No , Fl -quiet
26 Suppress prompting of the user for units and the display of statistics
27 about the number of units loaded.
28 .It Fl U \&No , Fl -unitsfile
29 If the default unit file exists prints its location.
32 Units data file not found
34 .It Fl t \&No , Fl -terse
35 Only print the result. This is used when calling
37 from other programs for easy to parse results.
38 .It Fl v \&No , Fl -verbose
39 Print the units in the conversion output.
40 Be more verbose in general.
41 .It Fl o Ar format \&No , Fl -output-format Ar format
42 Select the output format string by which numbers are printed.
43 .It Fl V \&No , Fl -version
44 Print the version number, usage, and then exit.
45 .It Ar from-unit to-unit
46 Allow a single unit conversion to be done directly from the command
48 The program will not print prompts.
50 result of the single specified conversion.
55 program converts quantities expressed in various scales to
56 their equivalents in other scales.
60 handle multiplicative or affine scale changes.
61 It works interactively by prompting
75 You want: furlongs/fortnight
89 Powers of units can be specified using the '^' character as shown in
90 the example, or by simple concatenation: 'cm3' is equivalent to 'cm^3'.
91 Multiplication of units can be specified by using spaces, a dash or
93 Division of units is indicated by the slash ('/').
94 Note that multiplication has a higher precedence than division,
95 so 'm/s/s' is the same as 'm/s^2' or 'm/s s'.
97 must be indicated using the vertical bar ('|').
99 meter, you would write '1|2 meter'.
100 If you write '1/2 meter' then the
101 units program would interpret that as equivalent to '0.5/meter'.
102 If you enter incompatible unit types, the units program will
103 print a message indicating that the units are not conformable and
104 it will display the reduced form for each unit:
107 You want: fathoms kg^2 / day
109 2.7777778e-11 kg m^2 / sec^3
110 2.1166667e-05 kg^2 m / sec
113 The conversion information is read from a units data file.
115 file includes definitions for most familiar units, abbreviations and
117 Some constants of nature included are:
119 .Bl -column -offset indent -compact "mercury"
120 .It "pi ratio of circumference to diameter"
121 .It "c speed of light"
122 .It "e charge on an electron"
123 .It "g acceleration of gravity"
124 .It "force same as g"
125 .It "mole Avogadro's number"
126 .It "water pressure per unit height of water"
127 .It "mercury pressure per unit height of mercury"
128 .It "au astronomical unit"
131 The unit 'pound' is a unit of mass.
132 Compound names are run together
133 so 'pound force' is a unit of force.
134 The unit 'ounce' is also a unit
136 The fluid ounce is 'floz'.
137 British units that differ from
138 their US counterparts are prefixed with 'br', and currency is prefixed
139 with its country name: 'belgiumfranc', 'britainpound'.
141 for a unit, if the specified string does not appear exactly as a unit
144 will try to remove a trailing 's' or a
145 trailing 'es' and check again for a match.
147 To find out what units are available read the standard units file.
148 If you want to add your own units you can supply your own file.
149 A unit is specified on a single line by
150 giving its name and an equivalence.
152 new units in terms of old ones so that a reduction leads to the
153 primitive units which are marked with '!' characters.
156 program will not detect infinite loops that could be caused
157 by careless unit definitions.
158 Comments in the unit definition file
159 begin with a '#' or '/' character at the beginning of a line.
161 Prefixes are defined in the same way as standard units, but with
162 a trailing dash at the end of the prefix name.
163 If a unit is not found
164 even after removing trailing 's' or 'es', then it will be checked
165 against the list of prefixes.
166 Prefixes will be removed until a legal
167 base unit is identified.
169 Here is an example of a short units file that defines some basic
172 .Bl -column -offset indent -compact "minute"
183 .Bl -tag -width /usr/share/misc/definitions.units -compact
184 .It Pa /usr/share/misc/definitions.units
185 the standard units library
188 .An Adrian Mariano Aq Mt adrian@cam.cornell.edu
190 The effect of including a '/' in a prefix is surprising.
192 Exponents entered by the user can be only one digit.
193 You can work around this by multiplying several terms.
195 The user must use | to indicate division of numbers and / to
196 indicate division of symbols.
197 This distinction should not
200 The program contains various arbitrary limits on the length
201 of the units converted and on the length of the data file.
203 The program should use a hash table to store units so that
204 it does not take so long to load the units list and check