2018-09-28 10:08:06 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-09-12 01:38:54 +00:00
|
|
|
BASEDIR=$(dirname "$0")
|
|
|
|
|
2018-09-08 09:40:38 +00:00
|
|
|
current=$(date "+%Y")
|
|
|
|
for ((year=1900; year<=current; year=year+1))
|
|
|
|
do
|
2018-09-12 01:38:54 +00:00
|
|
|
grep "/$year/" "$BASEDIR/README.md" | grep -v "($year)" | grep -v " - (" | while read -r line
|
2018-09-08 11:25:39 +00:00
|
|
|
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" )
|
2018-09-12 01:38:54 +00:00
|
|
|
sed -i.bak "s;$orig;$replace;g" "$BASEDIR/README.md"
|
2018-09-08 11:25:39 +00:00
|
|
|
done
|
2018-09-08 09:40:38 +00:00
|
|
|
done
|