Mercurial > buddylistgrapher
comparison graph_sed.sh @ 11:3af263aed951
cleanups in sed variant
author | meillo@marmaro.de |
---|---|
date | Sat, 09 Jun 2007 00:26:35 +0200 |
parents | 79af6ba23e46 |
children | fe4ccf810364 |
comparison
equal
deleted
inserted
replaced
10:9a85a9924834 | 11:3af263aed951 |
---|---|
33 else | 33 else |
34 | 34 |
35 file=/tmp/`basename $0`-$$ | 35 file=/tmp/`basename $0`-$$ |
36 file2=/tmp/`basename $0`-$$-2 | 36 file2=/tmp/`basename $0`-$$-2 |
37 | 37 |
38 # # collect all profil names (we only want them as nodes) | |
39 # cat $file | while read line ; do | |
40 # echo -n "`echo $line | grep "Profil von:" | awk '{print " " $3 " "}'`" >> $file2 | |
41 # done | |
42 # echo >> $file2 | |
43 | |
44 | |
45 # TODO: fetch only edges for people having a profile | |
46 | |
47 # output | |
48 | 38 |
49 sed -n -e ' | 39 sed -n -e ' |
50 /^Profil/{ | 40 /^Profil/{ |
51 s/Profil von: \(.\+\)/"\1";/ | 41 s/Profil von: \(.\+\)/"\1";/ |
52 w /tmp/aa | 42 w /tmp/aa |
71 echo "digraph G {" | 61 echo "digraph G {" |
72 grep -f /tmp/aa /tmp/bb | 62 grep -f /tmp/aa /tmp/bb |
73 echo "}" | 63 echo "}" |
74 | 64 |
75 # rm $file $file2 | 65 # rm $file $file2 |
66 rm /tmp/aa /tmp/bb | |
76 exit 0 | 67 exit 0 |
77 | 68 |
78 fi | 69 fi |
79 else | 70 else |
80 echo "usage: $0 <input.txt>" | 71 echo "usage: $0 <input.txt>" |