More work on grep mode.