# HG changeset patch # User meillo@marmaro.de # Date 1181340803 -7200 # Node ID 9a85a9924834832e34fc9c0f95ddee2fa64ca2b6 # Parent 79af6ba23e4638183cb38dddd941ceba35eeb5d4 rename diff -r 79af6ba23e46 -r 9a85a9924834 graph2.sh --- a/graph2.sh Sat Jun 09 00:13:00 2007 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -#!/bin/bash -# -# Autor: Julian Forster (www.ProgMaschine.de.vu) -# Autor: markus schnalke (prog.marmaro.de) -# - - -if [ $# -eq 1 ]; then - if [ $1 = '--version' ] ; then - echo 'Buddylistgrapher (shell)' - echo '========================' - echo 'version 0.2' - echo - echo 'by Julian Forster (http://progmaschine.de.vu)' - echo 'and Markus Schnalke (http://prog.marmaro.de)' - exit 0 - elif [ $1 = '--help' ] ; then - echo 'Buddylistgrapher (shell)' - echo '========================' - echo - echo "usage: $0 " - echo - echo "The grapher generates output to stdout." - echo "This output is the input for the graphviz tools." - echo - echo "You can use it like this:" - echo "$0 input.txt | dot -Tpng > pic.png" - echo - echo "ToDo:" - echo "The program was written for one specific kind of input data," - echo "so there is still some work to do to use it for general input." - exit 0 - else - - file=/tmp/`basename $0`-$$ - file2=/tmp/`basename $0`-$$-2 - - # extract all needed lines - grep -e "Profil von:" -e "Nachricht schreiben" $1 > $file - - - # collect all profil names (we only want them as nodes) - cat $file | while read line ; do - echo -n "`echo $line | grep "Profil von:" | awk '{print " " $3 " "}'`" >> $file2 - done - echo >> $file2 - - - # output - echo "digraph G {" - - cat $file | while read line ; do - if [ -n "`echo $line | grep "Profil von:"`" ] ; then - name=$(echo $line | awk '{ print $3 }') - else - buddy=$(echo $line | awk '{ print $3 }') - if [ -n "`grep -F " $buddy " $file2`" ] ; then - echo " \"$name\" -> \"$buddy\";" - fi - fi - done - - echo "}" - - rm $file $file2 - exit 0 - - fi -else - echo "usage: $0 " - exit 1 -fi diff -r 79af6ba23e46 -r 9a85a9924834 graph_sh.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graph_sh.sh Sat Jun 09 00:13:23 2007 +0200 @@ -0,0 +1,72 @@ +#!/bin/bash +# +# Autor: Julian Forster (www.ProgMaschine.de.vu) +# Autor: markus schnalke (prog.marmaro.de) +# + + +if [ $# -eq 1 ]; then + if [ $1 = '--version' ] ; then + echo 'Buddylistgrapher (shell)' + echo '========================' + echo 'version 0.2' + echo + echo 'by Julian Forster (http://progmaschine.de.vu)' + echo 'and Markus Schnalke (http://prog.marmaro.de)' + exit 0 + elif [ $1 = '--help' ] ; then + echo 'Buddylistgrapher (shell)' + echo '========================' + echo + echo "usage: $0 " + echo + echo "The grapher generates output to stdout." + echo "This output is the input for the graphviz tools." + echo + echo "You can use it like this:" + echo "$0 input.txt | dot -Tpng > pic.png" + echo + echo "ToDo:" + echo "The program was written for one specific kind of input data," + echo "so there is still some work to do to use it for general input." + exit 0 + else + + file=/tmp/`basename $0`-$$ + file2=/tmp/`basename $0`-$$-2 + + # extract all needed lines + grep -e "Profil von:" -e "Nachricht schreiben" $1 > $file + + + # collect all profil names (we only want them as nodes) + cat $file | while read line ; do + echo -n "`echo $line | grep "Profil von:" | awk '{print " " $3 " "}'`" >> $file2 + done + echo >> $file2 + + + # output + echo "digraph G {" + + cat $file | while read line ; do + if [ -n "`echo $line | grep "Profil von:"`" ] ; then + name=$(echo $line | awk '{ print $3 }') + else + buddy=$(echo $line | awk '{ print $3 }') + if [ -n "`grep -F " $buddy " $file2`" ] ; then + echo " \"$name\" -> \"$buddy\";" + fi + fi + done + + echo "}" + + rm $file $file2 + exit 0 + + fi +else + echo "usage: $0 " + exit 1 +fi