The rw-min program

rw-min stamp1 stamp2 [VAR program arg ...]

rw-min computes the smaller of the two given timstamps. Then, if no variable name and command are given, it prints the result on stdout. Otherwise, it sets the environment variable to contain the result and runs the given command.