[go: up one dir, main page]

File: install-html

package info (click to toggle)
altos 1.9.16-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 78,396 kB
  • sloc: ansic: 110,166; java: 42,103; makefile: 7,904; sh: 4,375; xml: 2,155; pascal: 2,008
file content (32 lines) | stat: -rwxr-xr-x 521 bytes parent folder | download | duplicates (6)
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