projects
/
lectures
/
dfb-slides.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b1d5988
)
changes
author
hackbard
<hackbard>
Fri, 28 Feb 2003 15:12:01 +0000
(15:12 +0000)
committer
hackbard
<hackbard>
Fri, 28 Feb 2003 15:12:01 +0000
(15:12 +0000)
create-xml
patch
|
blob
|
history
diff --git
a/create-xml
b/create-xml
index
9cf5f5b
..
753308e
100755
(executable)
--- a/
create-xml
+++ b/
create-xml
@@
-1,16
+1,20
@@
#!/bin/sh
#!/bin/sh
-if [ -z "$1" ]; then
- echo "usage: $0 <name.xml> <
unterpunkte kapitel 1> ... <... kappitel n
>"
+if [ -z "$1"
-o -z "$2"
]; then
+ echo "usage: $0 <name.xml> <
metafile
>"
exit
fi
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
# print normal header
-cat > $
dir/$
name << EOF
+cat > $name << EOF
<?xml version='1.0'?>
<slides effect="slide top left, blend"
<?xml version='1.0'?>
<slides effect="slide top left, blend"
@@
-22,89
+26,86
@@
cat > $dir/$name << EOF
<slide effect="none">
<header size="10"></header>
<slide effect="none">
<header size="10"></header>
- <header fgcolor="#5080FF" size="80">$
dir
</header>
+ <header fgcolor="#5080FF" size="80">$
topic
</header>
<header size="20"></header>
<header size="20"></header>
- <header fgcolor="#5080FF" size="35">desc</header>
+ <header fgcolor="#5080FF" size="35">
$
desc</header>
<header size="40"></header>
<header size="40"></header>
- <text>
authors
</text>
+ <text>
$author
</text>
<text/>
<text/>
- <text>email: </text>
- <text>event: </text>
- <text>location: </text>
+ <text>email:
$email
</text>
+ <text>event:
$event
</text>
+ <text>location:
$location
</text>
</slide>
EOF
</slide>
EOF
-total=
$#
+total=
`tail -1 $file | awk -F^ '{ print $1 }'`
((count = 0))
((count = 0))
-cat >> $
dir/$
name << EOF
+cat >> $name << EOF
<slide>
<header size="10"></header>
<header fgcolor="#8080FF" size="35">Inhalt</header>
<header size="20"></header>
EOF
<slide>
<header size="10"></header>
<header fgcolor="#8080FF" size="35">Inhalt</header>
<header size="20"></header>
EOF
-
for i in $@
; do
+
while [ "1" ]
; do
((j = 0))
((count += 1))
((j = 0))
((count += 1))
- cat >> $dir/$name << EOF
- <text size="20">Kapitel $count</text>
+ kapitel=`grep ^${count} $file | awk -F^ '{ print $2 }'`
+ # j_max=`grep ^${count} $file | sed 's/\^/ /g' | wc -w`
+ # ((j_max -= 2))
+ cat >> $name << EOF
+ <text size="20">$kapitel</text>
<text/>
EOF
<text/>
EOF
- while [ "1" ]; do
- ((j += 1))
- cat >> $dir/$name << EOF
- <listitem size="20">$j</listitem>
+ for up in `grep ^${count} $file | awk -F^ '{ for(i=3;i<=NF;i++) print $i }'`; do
+ cat >> $name << EOF
+ <listitem size="20">$up</listitem>
EOF
EOF
- [ "$j" = "$i" ] && break
done
done
- cat >> $
dir/$
name << EOF
+ cat >> $name << EOF
<text/>
EOF
<text/>
EOF
+ [ "$count" = "$total" ] && break
done
done
-cat >> $
dir/$
name << EOF
+cat >> $name << EOF
</slide>
EOF
</slide>
EOF
-((count = 0))
-for i in $@; do
+((count = 0))
+while [ "1" ]; do
((count += 1))
((count += 1))
- cat >> $dir/$name << EOF
+ kapitel=`grep ^${count} $file | awk -F^ '{ print $2 }'`
+ cat >> $name << EOF
<slide>
<header size="10"></header>
<slide>
<header size="10"></header>
- <header fgcolor="#8080FF" size="35">
Kapitel $count
</header>
+ <header fgcolor="#8080FF" size="35">
$kapitel
</header>
<header size="20"></header>
EOF
((j = 0))
<header size="20"></header>
EOF
((j = 0))
- while [ "1" ]; do
- ((j += 1))
- cat >> $dir/$name << EOF
- <text size="20">$j</text>
+ for up in `grep ^${count} $file | awk -F^ '{ for(i=3;i<=NF;i++) print $i }'`; do
+ cat >> $name << EOF
+ <text size="20">$up</text>
<text/>
<text/>
- <listitem size="20">
dd, wenn zuviel! :)
</listitem>
- <listitem size="20">
dd, wenn zuviel! :)
</listitem>
-
<listitem size="20">dd, wenn zuviel! :)
</listitem>
-
<listitem size="20">dd, wenn zuviel! :)
</listitem>
+ <listitem size="20">
muster
</listitem>
+ <listitem size="20">
muster
</listitem>
+
<listitem size="20">muster
</listitem>
+
<listitem size="20">muster
</listitem>
<text/>
EOF
<text/>
EOF
- if [ "$i" = "$j" ]; then
- echo "debug: writing $j, finished"
- break
- else
- echo "debug: writing $j from $i"
- fi
done
done
- cat >> $
dir/$
name << EOF
+ cat >> $name << EOF
</slide>
</slide>
-
EOF
EOF
+ [ "$count" = "$total" ] && break
done
done
-cat >> $dir/$name << EOF
+
+cat >> $name << EOF
</slides>
EOF
</slides>
EOF