buddylistgrapher

changeset 13:fe4ccf810364

some cleanups in sed-variant
author meillo@marmaro.de
date Sat, 09 Jun 2007 12:20:43 +0200
parents 91f3e84482fa
children dbaa8a943271
files graph_sed.sh
diffstat 1 files changed, 13 insertions(+), 11 deletions(-) [+]
line diff
     1.1 --- a/graph_sed.sh	Sat Jun 09 12:16:22 2007 +0200
     1.2 +++ b/graph_sed.sh	Sat Jun 09 12:20:43 2007 +0200
     1.3 @@ -35,11 +35,12 @@
     1.4      file=/tmp/`basename $0`-$$
     1.5      file2=/tmp/`basename $0`-$$-2
     1.6  
     1.7 -    
     1.8 -    sed -n -e ' 
     1.9 +
    1.10 +    # sed
    1.11 +    sed -n -e " 
    1.12        /^Profil/{
    1.13 -        s/Profil von: \(.\+\)/"\1";/
    1.14 -        w /tmp/aa
    1.15 +        s/Profil von: \(.\+\)/\"\1\";/
    1.16 +        w $file
    1.17          s/;$//
    1.18          h
    1.19          #p
    1.20 @@ -49,21 +50,22 @@
    1.21        /^Nachricht/{
    1.22          G
    1.23          s/ - [-0-9]\+//
    1.24 -        s/Nachricht schreiben \(.\+\)\n/"\1" /
    1.25 -        s/"\(.\+\)" "\(.\+\)"/  "\2" -> "\1";/
    1.26 +        s/Nachricht schreiben \(.\+\)\n/\"\1\" /
    1.27 +        s/\"\(.\+\)\" \"\(.\+\)\"/  \"\2\" -> \"\1\";/
    1.28  
    1.29          # write out
    1.30          #p
    1.31 -        w /tmp/bb
    1.32 +        w $file2
    1.33        }
    1.34 -    ' $1
    1.35 +    " $1
    1.36  
    1.37 +    # output
    1.38      echo "digraph G {"
    1.39 -    grep -f /tmp/aa /tmp/bb
    1.40 +    grep -f $file $file2
    1.41      echo "}"
    1.42  
    1.43 -#    rm $file $file2
    1.44 -    rm /tmp/aa /tmp/bb
    1.45 +    # cleanup
    1.46 +    rm $file $file2
    1.47      exit 0
    1.48  
    1.49    fi