#! /bin/sh MP=false style=graphs img=png files=`ls data | egrep "[^0-9](25|50|100)-" | sed 's:.dat::'` while [ $# -gt 0 ]; do case $1 in -mp) shift; MP=true ;; -check) shift; style=check ;; -root*) shift; style=roots ;; -graph*)shift; style=graphs ;; -gif) shift; img=gif ;; -png) shift; img=png ;; [0-9][0-9]*) files=`ls data | egrep "[^0-9]$1-" | sed 's:.dat::'` shift ;; *) echo "Bad arg: $1."; exit ;; esac done echo "dographs: style=$style, MP=$MP, img=$img" if [ $style = graphs -o $style = roots ]; then dir=$style if [ ! -d $dir ]; then mkdir $dir; fi for f in $files; do echo $f if [ $MP = true ]; then nice ./nodegraph -$style -$img $dir/$f.$img & else ./nodegraph -$style -$img $dir/$f.$img ; fi done elif [ $style = check ]; then for dir in graphs roots; do echo "Checking $dir for missing images" for f in $files; do if [ ! -f $dir/$f.$img ]; then echo "Creating $f.$img" ./nodegraph -$dir -$img $dir/$f.$img fi done echo "Checking $dir for 0 length images" for f in $files; do if [ ! -s $dir/$f.$img ]; then echo "Rebuilding $f" ./nodegraph -$dir -$img -rand $dir/$f.$img fi done done else echo "Bad style: $style" fi