Mercurial > buddylistgrapher
comparison 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 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:21d9547ef242 |
---|---|
1 #!/bin/bash | |
2 # | |
3 # Autor: Julian Forster | |
4 # www.ProgMaschine.de.vu | |
5 # | |
6 # | |
7 | |
8 if [ $# -eq 1 ]; then | |
9 file=/tmp/`basename $0`-$$ | |
10 grep -e "Profil von:" -e "Nachricht schreiben" $1 > $file | |
11 | |
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 }') | |
17 | |
18 else | |
19 buddy=$(echo $line | awk '{ print $3 }') | |
20 echo "\"$name\" -> \"$buddy\";" | |
21 | |
22 fi | |
23 done | |
24 | |
25 echo "}" | |
26 | |
27 exit 0 | |
28 else | |
29 echo "" | |
30 exit 1 | |
31 fi |