Code extracted from a Jon Bentley article that uses awk(1) as an interactive calculator with a history tape. Thanks, Jon!