root/honeyclient/branches/exp/kindlund-simpler_agent/update_copyright.sh

Revision 1419, 0.8 kB (checked in by kindlund, 8 months ago)

Updated copyright.

  • Property svn:executable set to *
  • Property svn:keywords set to Id "$file"
Line 
1 #!/usr/bin/bash
2
3 # $Id$
4
5 if [ -z $1 ] || [ -z $2 ] ; then
6     echo "Copyright Updater"
7     echo "Usage: $0 <old_year> <new_year>"
8     echo ""
9     echo "Example: $0 2007 2008"
10     echo ""
11     exit
12 fi
13
14 OLD_VERSION=$(echo $1 | sed -e 's/\./\\./g')
15 NEW_VERSION=$(echo $2 | sed -e 's/\./\\./g')
16
17 FILES=$(grep -r -P $OLD_VERSION lib/* | grep -v .svn | sed -e 's/:.*//g' | uniq)
18
19 echo "Updating copyrights in the following files:"
20 echo ""
21 for FILE in $FILES ; do
22     TMPFILE=$(mktemp)
23     echo "($1 -> $2) $FILE"
24     cat $FILE | sed -e "s/Copyright (C) ${OLD_VERSION} The MITRE Corporation./Copyright (C) ${NEW_VERSION} The MITRE Corporation./g" > $TMPFILE
25     mv $TMPFILE $FILE
26 done
27
28 echo ""
29 echo "Done.  Be sure to do an 'svn diff' before commiting,"
30 echo "in order to verify that no other data got altered."
Note: See TracBrowser for help on using the browser.