summaryrefslogtreecommitdiff
path: root/doc/install-html
blob: 71c7933c50981ffbc90767ea8c637c8e20f3378a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
destination=
state=arg
for file in "$@"; do
    case $state in
	arg)
	    case $file in
		-d)
		    state=destination
		    ;;
		*)
		    base=`basename $file`
		    case "$destination" in
			"")
			    echo "Need -d destination option before files" 1>&2
			    exit 1
			    ;;
			*)
			    sed \
				-e 's/<[?]xml [^>]*>//' \
				-e 's/<!DOCTYPE [^>]*>//' "$file" > "$destination/$base"
			    ;;
		    esac
		    ;;
	    esac
	    ;;
	destination)
	    destination=$file
	    state=arg
	    ;;
    esac
done