buddylistgrapher

view graph.sh @ 7:ccd2ab1bc9fd

rename; added hgignore
author meillo@marmaro.de
date Sat, 09 Jun 2007 00:07:04 +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