Solaris's /bin/sh is plain jane bourne shell so it doesn't have "read -r".
Use bash as the shell for the concatfragments.sh script instead.