Commit 8ba0a8a9 authored by Andy Yates's avatar Andy Yates
Browse files

Adding in a script to make the yearly copyright notification update a bit easier

parent 13973885
function confirm()
echo -n "$@ "
read -e answer
for response in y Y yes YES Yes Sure sure SURE OK ok Ok
if [ "_$answer" == "_$response" ]
return 0
return 1
year=$(date "+%Y")
last_year=$(($year - 1))
search="Copyright (c) 1999-${last_year}"
replacement="Copyright (c) 1999-${year}"
confirm "About to scan $(pwd) for files to replace '$search' with '$replacement'. Ok?"
for file in $(grep -R --files-with-matches "$search" .); do
echo "Replacing date in $file"
sed -i "s/$search/$replacement/g" $file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment