Have you ever been in a position where you need to prepend a header file to a series of other files? Typically, if you have created a series of program files and needed to add a standard copyright notice at the top of every file in the suite, then this would be the case.
Below is a method of achieving exactly this. We are going to use the UNIX tac command line utility (cat backwards!) to achieve this, and use a shell script for statement to loop though each file in the directory.
The basic syntax will be:
tac program_file prepend_file | tac > new_file