Alan Grosskurth's redo implementation in Bourne shell