#!/bin/bash OUTF='/tmp/out_a*.png' rm $OUTF make t && ./t A_PART=$(ls -1 $OUTF) Z_PART=$(ls -r1 $OUTF) convert -delay 10 ${A_PART} ${Z_PART} foo.gif