Possible Duplicate:
How can I prepend a tag to the beginning of several files?
Other than create a temporarily file with a line at the heading, and move it back when finished, is there a standard way to prepend some lines to a file?
i.e sometimes you do (echo #GPL license; cat $file) > tmpfile; mv tmpfile $file
EDIT2
In the first place, I was just trying to see if there's a standard command that ships with common distros, I guess not
EDIT
And notice that the source to prepend might not just be a fixed string, it could be a file as well, i.e cat $header $file > tmpfile; mv tmpfile $file
(echo #GPL license; cat $file) > tmpfile; mv tmpfile $file
– daisy Nov 28 '12 at 12:04&& mv ...
instead of; mv ...
-- that will keep $file from being overwritten with "bad" content. – glenn jackman Nov 28 '12 at 15:45