2018-09-08 09:40:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
current=$(date "+%Y")
|
|
|
|
for ((year=1900; year<=current; year=year+1))
|
|
|
|
do
|
2018-09-08 11:25:39 +00:00
|
|
|
grep "/$year/" README.md | grep -v "($year)" | grep -v " - (" | while read -r line
|
|
|
|
do
|
|
|
|
echo "$line"
|
2018-09-08 11:31:25 +00:00
|
|
|
replace=$(echo "$line" | sed "s/) - /) - ($year) /g" | sed -e "s#\*#\\\*#g" | sed -e "s#\[#\\\[#g" | sed -e "s#\]#\\\]#g" | sed -e "s#/#\\\/#g")
|
2018-09-08 11:25:39 +00:00
|
|
|
orig=$(echo "$line" | sed -e "s#/#\\\/#g" | sed -e "s#\*#\\\*#g" | sed -e "s#\[#\\\[#g" | sed -e "s#\]#\\\]#g" )
|
|
|
|
sed -i.bak "s;$orig;$replace;g" README.md
|
|
|
|
done
|
2018-09-08 09:40:38 +00:00
|
|
|
done
|