debug a shell script

Job ID: 30936693

Budget: $8 – $15 USD

Shell script was working before , but now there is a small bug which i can not find

bug is some entries are not been processed while others are ok.

Tell me in your own words what this script does and bid based on this taking you 4 hours to fix.
I will walk you through the steps
see attachment