 <p>Just check for carriage return character and new line, if the line index grows, but there is no carriage return or new line char (depending on OS) there IS a multiline string. Im not sure if this can be done with grep but should be quite easy to implement with any programming language or even bash</p>