# HG changeset patch # User meillo@marmaro.de # Date 1181384443 -7200 # Node ID fe4ccf81036430bc68faa5ada2f828e31a87e1ca # Parent 91f3e84482fa87bd473d36e2760755ea19373dbc some cleanups in sed-variant diff -r 91f3e84482fa -r fe4ccf810364 graph_sed.sh --- a/graph_sed.sh Sat Jun 09 12:16:22 2007 +0200 +++ b/graph_sed.sh Sat Jun 09 12:20:43 2007 +0200 @@ -35,11 +35,12 @@ file=/tmp/`basename $0`-$$ file2=/tmp/`basename $0`-$$-2 - - sed -n -e ' + + # sed + sed -n -e " /^Profil/{ - s/Profil von: \(.\+\)/"\1";/ - w /tmp/aa + s/Profil von: \(.\+\)/\"\1\";/ + w $file s/;$// h #p @@ -49,21 +50,22 @@ /^Nachricht/{ G s/ - [-0-9]\+// - s/Nachricht schreiben \(.\+\)\n/"\1" / - s/"\(.\+\)" "\(.\+\)"/ "\2" -> "\1";/ + s/Nachricht schreiben \(.\+\)\n/\"\1\" / + s/\"\(.\+\)\" \"\(.\+\)\"/ \"\2\" -> \"\1\";/ # write out #p - w /tmp/bb + w $file2 } - ' $1 + " $1 + # output echo "digraph G {" - grep -f /tmp/aa /tmp/bb + grep -f $file $file2 echo "}" -# rm $file $file2 - rm /tmp/aa /tmp/bb + # cleanup + rm $file $file2 exit 0 fi