build-scripts/update-copyright.sh
author Sam Lantinga <slouken@libsdl.org>
Tue, 26 May 2015 06:27:12 -0700
changeset 9618 5eec9af4374c
child 10000 acd714e378f4
permissions -rwxr-xr-x
Script from Sylvain to automate updating the copyright year
slouken@9618
     1
#!/bin/sh
slouken@9618
     2
slouken@9618
     3
find . -type f -exec grep -Il "Copyright" {} \;     \
slouken@9618
     4
| grep -v \.hg                             \
slouken@9618
     5
| while read i;                            \
slouken@9618
     6
do \
slouken@9618
     7
  sed -ie "s/\(.*Copyright.*\)[0-9]\{4\}\( *Sam Lantinga\)/\1`date +%Y`\2/" "$i"; \
slouken@9618
     8
  rm "${i}e"; \
slouken@9618
     9
done