I want to append the content of a file in my current directory to all the files in another directory recursively (so I need to append the content of that file to the files in the subdirectories too). So I tried to use find this way:

find dir -type f -exec cat toAppend >> {} \;

But it does not work as it seems to do nothing. What I'm doing wrong?

PS: I've solved the problem by doing

for i in `find dir -type f`
    cat toAppend >> $i

But I still cannot understand why my find invocation is wrong.



You must log in to answer this question.

Browse other questions tagged .