From fddc5a5684d06c92e99d086d8b1cb9c9fdc2186d Mon Sep 17 00:00:00 2001 From: hackbard Date: Fri, 28 Feb 2003 15:12:01 +0000 Subject: [PATCH] changes --- create-xml | 91 +++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/create-xml b/create-xml index 9cf5f5b..753308e 100755 --- a/create-xml +++ b/create-xml @@ -1,16 +1,20 @@ #!/bin/sh -if [ -z "$1" ]; then - echo "usage: $0 ... <... kappitel n>" +if [ -z "$1" -o -z "$2" ]; then + echo "usage: $0 " exit fi +name=$1 ; file=$2 -name=$1 ; shift 1 -dir=`echo $name | sed 's/.xml//'` -mkdir $dir +topic=`grep '^T' $file | awk -F^ '{ print $2 }'` +desc=`grep '^D' $file | awk -F^ '{ print $2 }'` +author=`grep '^A' $file | awk -F^ '{ print $2 }'` +email=`grep '^M' $file | awk -F^ '{ print $2 }'` +event=`grep '^E' $file | awk -F^ '{ print $2 }'` +location=`grep '^L' $file | awk -F^ '{ print $2 }'` # print normal header -cat > $dir/$name << EOF +cat > $name << EOF $dir/$name << EOF
-
$dir
+
$topic
-
desc
+
$desc
- authors + $author - email: - event: - location: + email: $email + event: $event + location: $location
EOF -total=$# +total=`tail -1 $file | awk -F^ '{ print $1 }'` ((count = 0)) -cat >> $dir/$name << EOF +cat >> $name << EOF
Inhalt
EOF -for i in $@; do +while [ "1" ]; do ((j = 0)) ((count += 1)) - cat >> $dir/$name << EOF - Kapitel $count + kapitel=`grep ^${count} $file | awk -F^ '{ print $2 }'` + # j_max=`grep ^${count} $file | sed 's/\^/ /g' | wc -w` + # ((j_max -= 2)) + cat >> $name << EOF + $kapitel EOF - while [ "1" ]; do - ((j += 1)) - cat >> $dir/$name << EOF - $j + for up in `grep ^${count} $file | awk -F^ '{ for(i=3;i<=NF;i++) print $i }'`; do + cat >> $name << EOF + $up EOF - [ "$j" = "$i" ] && break done - cat >> $dir/$name << EOF + cat >> $name << EOF EOF + [ "$count" = "$total" ] && break done -cat >> $dir/$name << EOF +cat >> $name << EOF
EOF -((count = 0)) -for i in $@; do +((count = 0)) +while [ "1" ]; do ((count += 1)) - cat >> $dir/$name << EOF + kapitel=`grep ^${count} $file | awk -F^ '{ print $2 }'` + cat >> $name << EOF
-
Kapitel $count
+
$kapitel
EOF ((j = 0)) - while [ "1" ]; do - ((j += 1)) - cat >> $dir/$name << EOF - $j + for up in `grep ^${count} $file | awk -F^ '{ for(i=3;i<=NF;i++) print $i }'`; do + cat >> $name << EOF + $up - dd, wenn zuviel! :) - dd, wenn zuviel! :) - dd, wenn zuviel! :) - dd, wenn zuviel! :) + muster + muster + muster + muster EOF - if [ "$i" = "$j" ]; then - echo "debug: writing $j, finished" - break - else - echo "debug: writing $j from $i" - fi done - cat >> $dir/$name << EOF + cat >> $name << EOF
- EOF + [ "$count" = "$total" ] && break done -cat >> $dir/$name << EOF + +cat >> $name << EOF
EOF -- 2.39.2