Adding my -bash.02, not nearly as neat as lars' code but still fairly compact.