1 of 3

Here's an sh script that produces the results you need.


cat patterns.txt |
while read -r pattern
    grep -e "$pattern" found.txt
    if [ $? -eq 1 ]
        echo "$pattern" not found

In this script, I assume you output the results of your grep to the file found.txt, and that you store your patterns in the file patterns.txt.

As you can see, the grep in the loop will produce the same contents of the file found.txt while adding "$pattern" not found for the missing ones.