#!/bin/sh

TEMP=`mktemp`

trap 'rm -f $TEMP' EXIT

AWK='BEGIN { m = 0; };
/}\)/ { print "}"; m = 0; };
/digraph/ { sub(".*digraph", "digraph", $0); m = 1 };
// { if (m == 1) {print} }'

./graph 2>&1 | tee $TEMP
awk "$AWK" < $TEMP | dot -Tsvg | display svg:-
