I have a sub-dir tree with varying number of branches and most ofthe branches contain .cpp files (many of them). I have a header-fileat the root of the tree that I want to have as a#include <constructed-relative-path-to-root>/headerfile.has the first line of each .cpp.an alternative to constructed-relative-path-to-root would be thehard-coded path, which would have to be adjusted whenever the project is relocated)a second alternative would be to copy the content of the header-file in at the top of each .cpp file I have no idea how to write such a script. Can anyone please help?
Script to insert line into files in sub-dirs
linux;scripting
From the root of your tree runfind . -name \*cpp | while read FILEdo    sed -i '1i #include rootpath/headerfile.h' $FILEdone