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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 250 - (hide annotations)
Thu Apr 29 21:43:28 2004 UTC (16 years, 2 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 frodo 149 #! /bin/sh
2 frodo 2
3 frodo 149 make_targets_file()
4 frodo 2 {
5 frodo 149 # local file line line_nr error targets_file files
6 frodo 2 targets_file="$1"
7     shift
8     files="$@"
9 frodo 250 printf "" > "$targets_file"
10 frodo 2
11     for file in $files; do
12     (
13     line_nr=1
14     while read line; do
15     error=0
16 frodo 250 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 frodo 2 echo $line | sed -e 's,^[^\[]*\[,,' -e 's,\].*$,,' \
20     >> "$targets_file"
21 frodo 149 else
22     echo "In \`$file\' line $line_nr: target brackets inbalance" >&2
23     error=1
24 frodo 2 fi
25     line=`echo $line | sed -e 's,^[^]]*\],,'`
26     done
27 frodo 250 if [ $error -eq 0 ] && echo $line | grep '\]' >/dev/null ; then
28 frodo 2 echo "In \`$file\' line $line_nr: target brackets inbalance" >&2
29     error=1
30     fi
31 frodo 250 line_nr=`echo "$line_nr + 1" | bc`
32 frodo 2 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