Grep command construction

Hi,

I have an array variable "arr" that reads string from a file "vari.txt". Thus, the array will be of variable length depending how many entries are present in "vari.txt"

I use a for loop to traverse through the array.

However, i need a grep command to grep for a file "output.txt" and displays all the lines of output.txt except those that are present in the arrar arr.

I know how to traverse an array, grep -v and how to grep for multiple strings simultaneously.

Can you help me how could i achieve the grep command that displays all the lines of "output.txt" except those that are present in the arrar arr.

vari.txt (in this sample we have 4 entries, but it can have more or less entries i.e it varies)

Hello
Yellow
Home
Fellow

output.txt

The grass is Green.
Fellow, The color is Yellow.
I like to see you play.
i rang you up and said HELLO

The desired result should be:

The grass is Green
I like to see you play.

Hi, it could be done without an intermediate shell variable of array, like this:

grep -viFf vari.txt output.txt

Note the "case insensitive" -i , otherwise HELLO would not match Hello

grep -viFf vari.txt output.txt
grep: illegal option -- F
grep: illegal option -- f
Usage: grep -hblcnsviw pattern file . . .

If i remove -F -f options i do not get the desired output. It displays all entries of output.txt.

SunOS mymac 5.10 Generic_150400-09 sun4v sparc SUNW,SPARC-Enterprise-T5220

Please help !!

Try using /usr/xpg4/bin/grep rather than grep .