#! /bin/sh style=pl file=false more=1; while [ $# -gt 0 -a $more -eq 1 ]; do case $1 in -p|*pl*) style=pl; shift ;; -s|*sw*) style=sw; shift ;; -b|*ba*) style=ba; shift ;; -d|*data*) file=true; shift; dir=$1; shift ;; *) more=0 ;; esac done N=${1:-100} K=${2:-4} Pr=""; if [ $N -lt 0 ]; then Pr="-"; N=`expr 0 - $N`; fi TF (){ if [ $1 = "true" ]; then echo "$2" ; else echo "$3" ; fi; } Out (){ if [ $file = true ]; then cat - > $dir/file$$ name=`head -1 $dir/file$$|sed 's/:.*//'` mv $dir/file$$ $dir/$name.dat else cat - fi } if [ $style = "pl" ]; then gamma=${3:-2.2} R=${4:-true} TD=${5:-true} C=${6:-true} java PLGraph $Pr$N $K $gamma $R $TD $C | Out elif [ $style = "ba" ]; then N0=${3:-$K} java BAGraph $Pr$N $K $N0 | Out elif [ $style = "sw" ]; then P=${3:-0.1} Augment=${4:-true} java SWGraph $Pr$N $K $P $Augment | Out else echo BAD STYLE exit fi exit ######################## TF (){ if [ $1 = "true" ]; then echo "T"; else echo "F" ; fi } echo Pr = $Pr, N = $N output=dot case $1 in -g*) shift; output=gif ;; # output a gif file -p*) shift; output=ps ;; # output a postscript file -d*) shift; output=dot ;; # output a dot file esac ./${style}run $@