Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
function confirm()
{
echo -n "$@ "
read -e answer
for response in y Y yes YES Yes Sure sure SURE OK ok Ok
do
if [ "_$answer" == "_$response" ]
then
return 0
fi
done
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
done
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