File: replace_copyright.sh

package info (click to toggle)
geogram 1.9.6-1
  • links: PTS, VCS
  • area: contrib
  • in suites: sid
  • size: 15,436 kB
  • sloc: cpp: 143,890; ansic: 10,098; perl: 1,430; sh: 1,199; yacc: 522; lex: 182; python: 157; javascript: 149; makefile: 17
file content (15 lines) | stat: -rwxr-xr-x 499 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function replace_copyright() {
    (cat tools/header.txt; awk  < $1 'BEGIN {STATE=0}{if(STATE==0 && $1 == "/*") {STATE=1} else if(STATE==1 && $1 == "*/") {STATE=2} else if(STATE==2) {print;} }') > /tmp/gloglo.txt
    mv /tmp/gloglo.txt $1
}

for i in `find . \( -name "*.h" -o -name "*.cpp" -o -name "*.c" \) -print`
do
   echo ">>>" $i
   if grep -q 'Contact: Bruno' $i; then
      echo "....replacing copyright in " $i
      replace_copyright $i
   else
      echo "....skipping " $i   
   fi
done