#!/bin/sh for i in `seq 20` ; do echo "$i. Doing $1" $1 >1 if [ $? -ne 0 ] ; then echo "Exit $?" exit 1 fi done