Units: A Unit Conversion Program
5. Invoking units
You invoke units like this:
| | units options [from-unit [to-unit]]
|
If the from-unit and to-unit are omitted, then the program
will use interactive prompts to determine which conversions to perform.
See section 2. Interacting with units.
If both from-unit and to-unit are given, units will
print the result of that single conversion and then exit.
If only from-unit appears on the command line, units will
display the definition of that unit and exit.
Units specified on the command line will need
to be quoted to protect them from shell interpretation and to group
them into two arguments. See section 3. Using units non-interactively.
The following options allow you to read in an alternative units file,
check your units file, or change the output format:
- `-c'
- `--check'
-
Check that all units and prefixes defined in the units data file reduce
to primitive units. Print a list of all units that
cannot be reduced. Also display some other diagnostics about
suspicious definitions in the units data file. Note that only
definitions active in the current locale are checked.
- `--check-verbose'
-
Like the `-check' option, this option prints a list of units that
cannot be reduced. But to help find unit definitions that cause
endless loops,
it lists the units as they are checked.
If
units hangs, then the last unit to be printed has a bad
definition. Note that only
definitions active in the current locale are checked.
- `-o format'
- `--output-format format'
-
Use the specified format for numeric output. Format is the same
as that for the printf function in the ANSI C standard.
For example, if you want more precision you might use `-o %.15g'.
- `-f filename'
- `--file filename'
-
Use filename as the units data file rather than the default units
data file. This option overrides the
UNITSFILE environment
variable.
- `-h'
- `--help'
-
Print out a summary of the options for
units.
- `-q'
- `--quiet'
- `--silent'
-
Suppress prompting of the user for units and the display of statistics
about the number of units loaded.
- `-s'
- `--strict'
-
Suppress conversion of units to their reciprocal units.
- `-v'
- `--verbose'
-
Give slightly more verbose output when converting units. When combined
with the `-c' option this gives the same effect as
`--check-verbose'.
- `-V'
- `--version'
-
Print program version number, tell whether the readline library
has been included, and give the location of the default units
data file.