Update Giancoli v6 to use Circ.asy v0.2.
[course.git] / html-includes.sh
1 #!/bin/bash
2 #
3 # I've occasionally had problems with .shtml inclusion for the header
4 # and footer.  Since there's not any processing going on in those
5 # files, they can be straight .html instead.  This script makes the
6 # necessary adjustments.
7 #
8 # In one installation, the errors raised in the apache logs were
9 #   unable to include potential exec
10 # since the SSI handler was attempting to parse the header/footer as
11 # well.  I'm not sure why it had a problem with that, but changing
12 # them to .html files means the SSI handler will no longer try to
13 # parse them and you avoid the problem.
14 #
15 #
16 # Usage: ./html-includes.sh
17
18 set -e # exit immediately on failed command
19 set -o pipefail # pipes fail if any stage fails
20 set -v # verbose, echo commands to stdout
21
22
23 for FILE in $(ls html/shared/ | grep '.shtml$'); do
24     mv -v "html/shared/${FILE}" "html/shared/${FILE/shtml/html}"
25     for CALLER in html/*.shtml; do
26         # correct links for callers
27         sed -i "s/shared\/$FILE/shared\/${FILE/shtml/html}/" "$CALLER"
28     done
29 done
30