view graph.sh @ 7:ccd2ab1bc9fd

rename; added hgignore
author meillo@marmaro.de
date Sat, 09 Jun 2007 00:07:04 +0200
parents 21d9547ef242
children
line wrap: on
line source

#!/bin/bash
# 
# Autor: Julian Forster
# www.ProgMaschine.de.vu
#
#

if [ $# -eq 1 ]; then
    file=/tmp/`basename $0`-$$
    grep -e "Profil von:" -e "Nachricht schreiben" $1 > $file

    echo "digraph G {"
    cat $file | while read line ; do
        isProfil=`echo $line | grep "Profil von:"`
        if [ -n "$isProfil" ] ; then
            name=$(echo $line |  awk '{ print $3 }')
            
        else
            buddy=$(echo $line |  awk '{ print $3 }')
            echo "\"$name\" -> \"$buddy\";"
            
        fi    
    done

    echo "}"

    exit 0
else
    echo ""
    exit 1
fi