changeset 6:e34b27b544b5

completed sed variant
author meillo@marmaro.de
date Sat, 09 Jun 2007 00:05:36 +0200
parents 2f455fc82355
children ccd2ab1bc9fd
files graph3.sh
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/graph3.sh	Mon May 28 23:10:54 2007 +0200
+++ b/graph3.sh	Sat Jun 09 00:05:36 2007 +0200
@@ -45,11 +45,12 @@
 # TODO: fetch only edges for people having a profile
 
     # output
-    echo "digraph G {"
     
     sed -n -e ' 
       /^Profil/{
-        s/Profil von: \(.\+\)/"\1"/
+        s/Profil von: \(.\+\)/"\1";/
+        w /tmp/aa
+        s/;$//
         h
         #p
       }
@@ -62,11 +63,13 @@
         s/"\(.\+\)" "\(.\+\)"/  "\2" -> "\1";/
 
         # write out
-        p
+        #p
+        w /tmp/bb
       }
     ' $1
 
-
+    echo "digraph G {"
+    grep -f /tmp/aa /tmp/bb
     echo "}"
 
 #    rm $file $file2