Add header(copyright) information to existing source files

后端 未结 6 2259
我在风中等你
我在风中等你 2021-02-09 08:18

I want to add our company\'s copyright information to all of our EXISTING source code files.

The project is developed in Eclipse. so, for new files I can m

6条回答
  •  执念已碎
    2021-02-09 08:54

    Correcting Konstantin's solution:

    find . -name \*.java -exec sh -c "mv '{}' tmp && cp copyright '{}' && cat tmp >> '{}' && rm tmp" \;
    

    Problem was that && is being interpreted by the shell directly instead of being passed to find. Escaping them is no solution either, as the find exec does not understand them. So just give the whole command to some shell.

提交回复
热议问题