in reply to list lines not found in config (while+if)

My results agree with kennethk's.

It sounds like you are describing egrep, if you have that available to you on your OS:

$ egrep -v -f file1 file2 > file3

Update: Since you have not given us enough to reproduce your problem, I recommend that you start sprinkling your code with more print's. Refer to Basic debugging checklist for more details.