Your script works here on cygwin.

But I prefer letting find do the directory browsing though...
Code:
find . -type f -exec  sha1sum {} \;
or
Code:
find . -type f | while read file ; do
   # do whatever what you wanna do here
   sha1sum $file
done
Peace always,
<jdenny>