Handle multiline output from grep and don't grep for empty strings.