buddylistgrapher
view graph.sh @ 16:dbaa8a943271
merge
author | ju |
---|---|
date | Thu, 05 Jul 2007 18:13:01 +0200 |
parents | |
children |
line source
1 #!/bin/bash
2 #
3 # Autor: Julian Forster
4 # www.ProgMaschine.de.vu
5 #
6 #
8 if [ $# -eq 1 ]; then
9 file=/tmp/`basename $0`-$$
10 grep -e "Profil von:" -e "Nachricht schreiben" $1 > $file
12 echo "digraph G {"
13 cat $file | while read line ; do
14 isProfil=`echo $line | grep "Profil von:"`
15 if [ -n "$isProfil" ] ; then
16 name=$(echo $line | awk '{ print $3 }')
18 else
19 buddy=$(echo $line | awk '{ print $3 }')
20 echo "\"$name\" -> \"$buddy\";"
22 fi
23 done
25 echo "}"
27 exit 0
28 else
29 echo ""
30 exit 1
31 fi