match blank lines and handle a failed exec