The program displays its results on the terminal screen, and optionally will produce a short statement on the standard line printer.
There are three versions of the program, based on the fact that there are three (or rather, two and one half) systems of measurement commonly used to measure distance travelled and fuel consumed.
USMPG is the American version of the program, requesting input in miles and US gallons.
UKMPG is the British version of the program, requesting input in miles and Imperial gallons. Obviously, it is useful anywhere where this combination of measurements is used.
EURMPG is the European or Decimal version of the program, requesting input in kilometers and liters. It is useful wherever the metric system has been fully implemented.
All three versions of the program print their results both for the current tank filling, and for the average from the first time a particular user used the program (old data for this purpose is kept in a file in the user's home directory.
All three versions print their results in three different formats:
- Miles per US Gallon - Miles per Imperial Gallon - Liters per 100 Kilometerswhich to my knowledge covers all common conventions to measure fuel efficiency.
The datafile $HOME/.mpgdata contains the total figures since the first time a particular user used the program, in the form of a single line of text. This line consists of five colon-delimited fields which contain the total miles, kilometers, US gallons, UK gallons, and liters. Here is a sample of the $HOME/.mpgdata file:
598.35:957.36:21.50:18.15:81.71 | | | | | miles | US Gall. | Liters kilometers UK Gall.