Initial version.
Modified to work on both Linux and Darwin systems.