#!/bin/bash sed -e '/^#/d' \ -e 's,/algo_.*,,' \ alldata \ | sort -u \ | while read cfg; do echo "##### $cfg #####" grep "^$cfg" alldata \ | sed 's/.*algo_//;s/_/ /' \ | sort -k2r,2 -k1r,1 \ | sed 's/ /_/' > data.tmp gnuplot -e "set title '$cfg'" ./plot rm data.tmp name=$(echo $cfg | tr :_ .-) mkdir -p "${name%/*}" mv data.tmp.pdf "$name".pdf done