lecture-notes/init.sh

10 lines
507 B
Bash
Raw Normal View History

2022-02-15 23:24:20 +01:00
#!/bin/bash
2022-02-15 23:29:07 +01:00
{
2022-02-15 23:20:19 +01:00
source config
2022-02-15 23:35:05 +01:00
find -type f | xargs sed -i "s/\$mainfile/$(printf '%s\n' "$mainfile" | sed -e 's/[\/&]/\\&/g')/g"
find -type f | xargs sed -i "s/\$course/$(printf '%s\n' "$course" | sed -e 's/[\/&]/\\&/g')/g"
find -type f | xargs sed -i "s/\$stylefile/$(printf '%s\n' "$stylefile" | sed -e 's/[\/&]/\\&/g')/g"
find -type f | xargs sed -i "s/\$repo/$(printf '%s\n' "$repo" | sed -e 's/[\/&]/\\&/g')/g"
find -type f | xargs sed -i "s/\$term/$(printf '%s\n' "$term" | sed -e 's/[\/&]/\\&/g')/g"
2022-02-15 23:29:07 +01:00
}