File: dhelp.build

package info (click to toggle)
doc-linux-sv 97.12-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 76 kB
  • ctags: 6
  • sloc: makefile: 46; sh: 36
file content (27 lines) | stat: -rwxr-xr-x 649 bytes parent folder | download
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
#!/bin/bash

if [ -f .dhelp ]; then
  rm -f .dhelp
fi

for i in *[!0-9].html ; do

  # produce .dhelp
  echo "<item>" >> .dhelp
  echo "<directory>"$1 >> .dhelp
  echo "<linkname>$i<" >> .dhelp
  echo "<filename>$i" >> .dhelp
  echo "<description>" >> .dhelp
  ANFANG=$(grep -n "<P><HR><EM>" $i | cut - -f1 -d:);
  ENDE=$(grep -n "</EM><HR></P>" $i | cut - -f1 -d:);
  head -n $ENDE $i | tail +$ANFANG | sed -e 's/<P><HR><EM>//g' | \
   sed -e 's/<\/EM><HR><\/P>//g' >> .dhelp
  echo "</description>" >> .dhelp
  echo "</item>" >> .dhelp
done

mv .dhelp 1.tmp
sed -e 's/.html<//' 1.tmp | \
sed -e 's/linkname>DE-/linkname>/'   > .dhelp

rm -f 1.tmp