prepend a textfile to another by Drew Bourne June 15th, 2007
for f in `find . -name {files.ext}`; do echo $f; cat {filename.ext} $f > $f.tmp; mv $f.tmp $f; done
Change {files.ext} to the pattern of the files you want to match.
Change {filename.ext} to the textfile you want to be prepended to the start of all the others.
Note: the original files will be overwritten.






June 22nd, 2007 at 9:41 am
Or …
find . -name findPattern -exec bash -c “cat prependFile {} > {}.new; mv {}.new {}” \;