sorry for late response, I have been very busy.
It looks "grep" command works differently if "." character is written in variable, don't know why this kind of behaviour. Work-around solution is to to replace the following string in row 19:
grep -v '$WHITE_PROCESSES_LIST'
So instead of single quotes use double quotes.
grep -v "$WHITE_PROCESSES_LIST"
This should work.
If you don't like above solution, then just use "npviewer" as WHITE_PROCESS_LIST variable, so without "." character.
Please write back if you solved the problem.