buddylistgrapher

view graph.sh @ 0:21d9547ef242

initial commit C++ and sh editions work similar
author meillo@marmaro.de
date Mon, 28 May 2007 17:41:28 +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