5 LOGFILE='get_examples.log'
9 res=`grep '<EXAMPLE>' $1 2> /dev/null`
12 name=`basename $1|sed -e 's/.xml//' `
13 out=examples/$name.tst
14 newest=`ls -t -1 $1 $out 2>/dev/null |sed -n -e '1p'`
15 if [ "$newest" = "$1" ]; then
16 echo "diary('examples/$name.dia')" > $out
17 echo "clear;lines(0);" >> $out
18 sed -e '1,/<EXAMPLE>/d' $1 |sed -e '/<\/EXAMPLE>/,$d'| \
19 sed -e 's/<\!\[CDATA\[//'|sed -e 's/ \]\]>//' >>$out
20 echo "$1" PROCESSED >> $LOGFILE
21 echo "for k=winsid(),xdel(k);end" >> $out
22 echo 'diary(0)' >> $out
25 echo "$1" NO EXAMPLE >> $LOGFILE
30 for j in arma control dcd elementary fileio functions graphics gui linear metanet nonlinear polynomials programming robust scicos signal sound strings tdcs translation tksci utilities
32 echo -n "Processing man/eng/$j "
33 for f in $SCI/man/eng/$j/*.xml
42 echo `grep PROCESSED $LOGFILE|wc -l` examples extracted from `cat $LOGFILE|wc -l` manual files.