/[public]/psiconv/trunk/formats/index_html.sh
ViewVC logotype

Contents of /psiconv/trunk/formats/index_html.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 250 - (show annotations)
Thu Apr 29 21:43:28 2004 UTC (16 years, 4 months ago) by frodo
File MIME type: application/x-sh
File size: 1006 byte(s)
(Frodo) Solaris /bin/sh compatibility updates

/bin/sh on Solaris is just braindead, if you are used to bash (or even
Sun's ksh)

1 #! /bin/sh
2
3 make_targets_file()
4 {
5 # local file line line_nr error targets_file files
6 targets_file="$1"
7 shift
8 files="$@"
9 printf "" > "$targets_file"
10
11 for file in $files; do
12 (
13 line_nr=1
14 while read line; do
15 error=0
16 while [ $error -eq 0 ] && echo $line | grep '\[' >/dev/null ; do
17 if echo $line | grep '\[.*\]' >/dev/null; then
18 printf "%s %s " "$file" "$line_nr" >> "$targets_file"
19 echo $line | sed -e 's,^[^\[]*\[,,' -e 's,\].*$,,' \
20 >> "$targets_file"
21 else
22 echo "In \`$file\' line $line_nr: target brackets inbalance" >&2
23 error=1
24 fi
25 line=`echo $line | sed -e 's,^[^]]*\],,'`
26 done
27 if [ $error -eq 0 ] && echo $line | grep '\]' >/dev/null ; then
28 echo "In \`$file\' line $line_nr: target brackets inbalance" >&2
29 error=1
30 fi
31 line_nr=`echo "$line_nr + 1" | bc`
32 done
33 ) < $file
34 done
35 }
36
37
38 make_targets_file "$@"

Properties

Name Value
svn:executable *

frodo@frodo.looijaard.name
ViewVC Help
Powered by ViewVC 1.1.26