You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UpdateCopyright.sh 570B

12345678910111213141516
  1. #!/bin/sh
  2. # Update Copyright headers in all files.
  3. MONTH=`date +%m`
  4. THISYEAR=`date +%Y`
  5. if [ ${MONTH} -eq 12 ]; then
  6. THISYEAR=$((${THISYEAR} + 1))
  7. elif [ ${MONTH} -ne 1 ]; then
  8. echo "This script only makes sense being run near the start of a year..."
  9. exit 1;
  10. fi;
  11. echo "Updating copyright to: ${THISYEAR}"
  12. find . -regextype posix-egrep -iregex '.*/(.*\.(java|sh|php|xml|dpr|nsh|html|htm)|dmdirc.license|LICENCE|licenseheader.txt|DMDirc-Apple.c|DMDirc - MIT|copyright)$' -exec sed -i 's/\(Copyright.*\)2006-20[0-9][0-9]\(.*DMDirc.*\)/\12006-'${THISYEAR}'\2/' {} \;