http://www.informit.com/articles/art...eqNum=15&rll=1
The above link explains /dev/fd. Generally /dev/fd/ has an entry for stdin, stdout, and stderr. stdin is /dev/fd/0.
Therefore, your code cats a file called header.txt, followed by stdin, followed by the file footer.txt, one after the other. It is the equivalent to:
cat header.txt - footer.txt
where the dash in the middle signifies stdin.
Sasha