I'm trying to search through a set of text files and return the names of files that on a specified line contain a text pattern OR do not contain the text on the specified. In my case I need to return the filenames of files whose last line does not contain the text pattern.
line2 must have
line1 must have
line2 return me
the function/command, when passed "must have", should return ONLY file2.txt, because it does not contain "must have" on the last line.