Oracle logo

Generate network graph from command line

September 25th, 2011 by igogo

I recently wrote on gnuplot, today I tried another command line utility to generate graphs, graphviz, version 2.24.0 on AIX5L.

Pretty straightforward syntax :

(
  echo "digraph Emp {"
    sqlplus -s -L scott/tiger  EOF
      set pages 0 lin 120 hea off feed off
      select 
        ename ||'-'|| 
        (select ename from emp where empno=e.mgr) || ';' 
      from emp e where mgr is not null;
EOF
  echo "}"
)| neato -Tpng | uuencode Emp.png | mailx laurentschneider@example.com

(or neato -Tpng -o Emp.png to save locally, or -Tps|lp, etc…)

Article source: http://laurentschneider.com/wordpress/2011/09/generate-network-graph-from-command-line.html

Leave a Reply