Command line utility to apply a command to groups of consecutive lines matching a pattern