Zgrep works at command line but not in script?

Hi all-

I'm trying to search through some .gz log files to verify certain feeds have passed through our app.

I have a small script that I wrote in hopes that I could automate the checking but haven't been able to get the zgrep to work. When I copy it to the command line directly it works fine?

The basics of the zgrep portion are:

While read line; do
zgrep "$line" $logfilename > ${resultfile}
done < ${feedfilename}

zgrep works in these cases.

I doubt in your variable values, check it. If you are not able to find then show the whole shell script to identify the issue.

What does the error say and what is the content of the feedfilename?