fixed script to be Bourne shell compatible.
the 'Found <n> print statements' is on the bottom of the output now though.