in reply to Cat multiple files into one pipe

I have some bad news, the script works the way you want it to on my system. That is, I am testing with three short text files and in the first line, I simply open "| cat". That works and cats out the three files as expected.

So as it stands, the logic you are using works for piping to cat. Can you get more specific on what you are piping your files into? This may be the source of the problem.