#! /bin/sh export GDFONTPATH="/usr/share/fonts/open-sans" export GNUPLOT_DEFAULT_GDFONT="OpenSans-Semibold" p=8 T=100 for coin in 0 1 2 3 do name="QW1-$coin-$p-$T"; f="$name.out"; g="$name.gif" echo "generating $f" ./QW1 "$coin" "$p" "$T" > "$f" echo "generating $g" title="Quantum Walk, coin=$coin, p=$p, T=$T" xlabel="position" ylabel="probability" labels="set title \"$title\"\nset xlabel \"$xlabel\"\nset ylabel \"$ylabel\"" egrep -v 'QW1:| 0$' "$f" | (printf "set term gif\nset output\n $labels\n plot '-' notitle with linespoints\n"; cat) | gnuplot > "$g" done