#! /bin/sh # name2plot [flags] Nm -> Coord Label style=all more=1; while [ $# -gt 0 -a $more -eq 1 ]; do case $1 in -c) style=coord; shift ;; -l) style=label; shift ;; -t) style=tag; shift ;; -v) style=vars; shift; CName=$1; shift; LName=$1; shift ;; *) more=0 ;; esac done #echo $1 # Nm N K x E M a m CC CP D PL DF BF Sh SM Sa Sm # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 # Bag 25 2 2 46 2 1.5 1 0.32 2.08 4 0.44 0.52 0.48 2.16 3.12 2.21 2.08 case $1 in R) Coord=0; Label='Rank'; Tag=$Label ;; R%) Coord=0; Label='Rank Percent'; Tag='Rank%' ;; Nm) Coord=1; Label='Name'; Tag=$Label ;; Z) Coord=1; Label=''; Tag=$Label ;; N) Coord=2; Label='Nodes'; Tag=$Label ;; K) Coord=3; Label='Node Degree'; Tag='Degree' ;; N0) Coord=4; Label='Bag N0'; Tag='N0' ;; G) Coord=4; Label='Gamma'; Tag=$Label ;; P|P0) Coord=4; Label='Rewiring Probability';Tag='P0' ;; E) Coord=5; Label='Edges'; Tag=$Label ;; M) Coord=6; Label='Level Maximum'; Tag='Max' ;; a) Coord=7; Label='Level Average'; Tag='Avg' ;; m) Coord=8; Label='Level Minimum'; Tag='Min' ;; CC) Coord=9; Label='Clustering Coefficient'; Tag='ClustCoeff' ;; CP) Coord=10; Label='Characteristic Path'; Tag='CharPath' ;; D) Coord=11; Label='Diameter'; Tag=$Label ;; PL|Pl) Coord=12; Label='Power Law Search'; Tag='PowerLaw' ;; D1) Coord=13; Label='Depth First Search'; Tag='DepthFirst' ;; B1) Coord=14; Label='Breadth First Search';Tag='BreadthFirst' ;; Sh) Coord=15; Label='Shortest Path'; Tag='ShortPath' ;; SM) Coord=16; Label='Sample Level Maximum';Tag='SamMax' ;; Sa) Coord=17; Label='Sample Level Average';Tag='SamAvg' ;; Sm) Coord=18; Label='Sample Level Minimum';Tag='SamMin' ;; *) echo "Bad Coordinate: $1"; exit esac case $style in all) echo $Coord $Label ;; coord) echo $Coord ;; label) echo $Label ;; tag) echo $Tag ;; vars) echo $CName=$Coord\; $LName=\"$Label\" ;; esac